public class

RegionEvent

extends Event
implements JsonSerializable
java.lang.Object
   ↳ com.urbanairship.analytics.Event
     ↳ com.urbanairship.location.RegionEvent

Class Overview

A RegionEvent defines a region with an identifier, major and minor and optional proximityRegion and/or circularRegion.

Summary

Nested Classes
@interface RegionEvent.Boundary  
Constants
int BOUNDARY_EVENT_ENTER Enter boundary event.
int BOUNDARY_EVENT_EXIT Exit boundary event.
int MAX_CHARACTER_LENGTH The maximum length for any region event string.
double MAX_LATITUDE The maximum latitude for a region in degrees.
double MAX_LONGITUDE The maximum longitude for a region in degrees.
double MIN_LATITUDE The minimum latitude for a region in degrees.
double MIN_LONGITUDE The minimum longitude for a region in degrees.
String REGION_ID The region ID key.
String TYPE The event type.
[Expand]
Inherited Constants
From class com.urbanairship.analytics.Event
Public Constructors
RegionEvent(String regionId, String source, int boundaryEvent)
Constructor for creating a region event.
Public Methods
int getBoundaryEvent()
Gets the boundary event type - will be either BOUNDARY_EVENT_ENTER or BOUNDARY_EVENT_EXIT.
int getPriority()
The event's send priority.
final String getType()
The event type.
boolean isValid()
Validates the Event.
void setCircularRegion(CircularRegion circularRegion)
Circular region setter.
void setProximityRegion(ProximityRegion proximityRegion)
Proximity region setter.
JsonValue toJsonValue()
Returns the objects represented as a JsonValue.
Protected Methods
final JsonMap getEventData()
Create the event data.
[Expand]
Inherited Methods
From class com.urbanairship.analytics.Event
From class java.lang.Object
From interface com.urbanairship.json.JsonSerializable

Constants

public static final int BOUNDARY_EVENT_ENTER

Enter boundary event.

Constant Value: 1 (0x00000001)

public static final int BOUNDARY_EVENT_EXIT

Exit boundary event.

Constant Value: 2 (0x00000002)

public static final int MAX_CHARACTER_LENGTH

The maximum length for any region event string.

Constant Value: 255 (0x000000ff)

public static final double MAX_LATITUDE

The maximum latitude for a region in degrees.

Constant Value: 90.0

public static final double MAX_LONGITUDE

The maximum longitude for a region in degrees.

Constant Value: 180.0

public static final double MIN_LATITUDE

The minimum latitude for a region in degrees.

Constant Value: -90.0

public static final double MIN_LONGITUDE

The minimum longitude for a region in degrees.

Constant Value: -180.0

public static final String REGION_ID

The region ID key.

Constant Value: "region_id"

public static final String TYPE

The event type.

Constant Value: "region_event"

Public Constructors

public RegionEvent (String regionId, String source, int boundaryEvent)

Constructor for creating a region event.

Parameters
regionId The ID of the region object.
source The source of the region definition.
boundaryEvent The type of boundary crossing event.

Public Methods

public int getBoundaryEvent ()

Gets the boundary event type - will be either BOUNDARY_EVENT_ENTER or BOUNDARY_EVENT_EXIT.

Returns
  • The boundary event type.

public int getPriority ()

The event's send priority.

Returns
  • The event's send priority.

public final String getType ()

The event type.

Returns
  • The event type.

public boolean isValid ()

Validates the Event.

Returns
  • True if valid, false otherwise.

public void setCircularRegion (CircularRegion circularRegion)

Circular region setter.

Parameters
circularRegion The optional circular region.

public void setProximityRegion (ProximityRegion proximityRegion)

Proximity region setter.

Parameters
proximityRegion The optional proximity region.

public JsonValue toJsonValue ()

Returns the objects represented as a JsonValue.

Returns
  • The object as a JsonValue.

Protected Methods

protected final JsonMap getEventData ()

Create the event data.

Returns
  • The event data.