public class

CustomEvent

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

Class Overview

A class that represents a custom event for the application.

Summary

Nested Classes
class CustomEvent.Builder Builder class for CustomEvent Objects. 
Constants
String CONVERSION_METADATA Hard conversion send metadata key.
String CONVERSION_SEND_ID Hard conversion send id key.
String EVENT_NAME The event name key.
String EVENT_VALUE The event value key.
String INTERACTION_ID The interaction ID key.
String INTERACTION_TYPE The interaction type key.
String LAST_RECEIVED_METADATA Last send metadata key.
int MAX_CHARACTER_LENGTH The max size for any String event value.
int MAX_TOTAL_PROPERTIES_SIZE The max size of total properties in bytes.
String MCRAP_TRANSACTION_TYPE Rich Push Message interaction type.
String PROPERTIES The custom properties key.
String TEMPLATE_TYPE The template type key.
String TRANSACTION_ID The event transaction id key.
[Expand]
Inherited Constants
From class com.urbanairship.analytics.Event
Public Methods
String getEventName()
Gets the event name.
BigDecimal getEventValue()
Gets the event value.
String getInteractionId()
Gets the interaction ID.
String getInteractionType()
Gets the interaction type.
JsonMap getProperties()
Gets the event properties.
String getTransactionId()
Gets the transaction ID.
final String getType()
The event type.
boolean isValid()
Validates the Event.
static CustomEvent.Builder newBuilder(String name)
Creates a new CustomEvent builder.
JsonValue toJsonValue()
Returns the objects represented as a JsonValue.
CustomEvent track()
Adds the event to Analytics.
[Expand]
Inherited Methods
From class com.urbanairship.analytics.Event
From class java.lang.Object
From interface com.urbanairship.json.JsonSerializable

Constants

public static final String CONVERSION_METADATA

Hard conversion send metadata key.

Constant Value: "conversion_metadata"

public static final String CONVERSION_SEND_ID

Hard conversion send id key.

Constant Value: "conversion_send_id"

public static final String EVENT_NAME

The event name key.

Constant Value: "event_name"

public static final String EVENT_VALUE

The event value key.

Constant Value: "event_value"

public static final String INTERACTION_ID

The interaction ID key.

Constant Value: "interaction_id"

public static final String INTERACTION_TYPE

The interaction type key.

Constant Value: "interaction_type"

public static final String LAST_RECEIVED_METADATA

Last send metadata key.

Constant Value: "last_received_metadata"

public static final int MAX_CHARACTER_LENGTH

The max size for any String event value.

Constant Value: 255 (0x000000ff)

public static final int MAX_TOTAL_PROPERTIES_SIZE

The max size of total properties in bytes.

Constant Value: 65536 (0x00010000)

public static final String MCRAP_TRANSACTION_TYPE

Rich Push Message interaction type.

Constant Value: "ua_mcrap"

public static final String PROPERTIES

The custom properties key.

Constant Value: "properties"

public static final String TEMPLATE_TYPE

The template type key.

Constant Value: "template_type"

public static final String TRANSACTION_ID

The event transaction id key.

Constant Value: "transaction_id"

Public Methods

public String getEventName ()

Gets the event name.

Returns
  • The event name.

public BigDecimal getEventValue ()

Gets the event value.

Returns
  • The event value.

public String getInteractionId ()

Gets the interaction ID.

Returns
  • The interaction ID.

public String getInteractionType ()

Gets the interaction type.

Returns
  • The interaction type.

public JsonMap getProperties ()

Gets the event properties.

Returns
  • The properties.

public String getTransactionId ()

Gets the transaction ID.

Returns
  • The transaction ID.

public final String getType ()

The event type.

Returns
  • The event type.

public boolean isValid ()

Validates the Event.

Returns
  • True if valid, false otherwise.

public static CustomEvent.Builder newBuilder (String name)

Creates a new CustomEvent builder.

Parameters
name The event name
Returns
  • The CustomEvent builder.

public JsonValue toJsonValue ()

Returns the objects represented as a JsonValue.

Returns
  • The object as a JsonValue.

public CustomEvent track ()

Adds the event to Analytics.

Returns
  • The tracked custom event.