java.lang.Object | |
↳ | com.urbanairship.analytics.CustomEvent.Builder |
Builder class for CustomEvent
Objects.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Builder(String eventName)
Creates a new custom event builder
The event name must be between 1 and 255 characters or the event will be invalid. |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CustomEvent.Builder |
addProperty(String name, JsonSerializable value)
Adds a custom property to the event.
| ||||||||||
CustomEvent.Builder |
addProperty(String name, boolean value)
Adds a custom property to the event.
| ||||||||||
CustomEvent.Builder |
addProperty(String name, int value)
Adds a custom property to the event.
| ||||||||||
CustomEvent.Builder |
addProperty(String name, double value)
Adds a custom property to the event.
| ||||||||||
CustomEvent.Builder |
addProperty(String name, String value)
Adds a custom property to the event.
| ||||||||||
CustomEvent.Builder |
addProperty(String name, long value)
Adds a custom property to the event.
| ||||||||||
CustomEvent |
build()
Builds the custom event.
| ||||||||||
CustomEvent.Builder |
setEventValue(double value)
Sets the event value.
| ||||||||||
CustomEvent.Builder |
setEventValue(int value)
Sets the event value.
| ||||||||||
CustomEvent.Builder |
setEventValue(String value)
Sets the event value from a String.
| ||||||||||
CustomEvent.Builder |
setEventValue(BigDecimal value)
Sets the event value.
| ||||||||||
CustomEvent.Builder |
setInteraction(String interactionType, String interactionId)
Sets the interaction type and ID for the event.
| ||||||||||
CustomEvent.Builder |
setMessageCenterInteraction(String richPushMessageId)
Sets the interaction type and ID from a Message Center message.
| ||||||||||
CustomEvent.Builder |
setProperties(JsonMap properties)
Sets a JsonMap representing the event properties.
| ||||||||||
CustomEvent.Builder |
setTransactionId(String transactionId)
Sets the transaction ID.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
|
Creates a new custom event builder
The event name must be between 1 and 255 characters or the event will be invalid.
eventName | The name of the event. |
---|
IllegalArgumentException | if the event name is null, empty, or exceeds 255 characters. |
---|
Adds a custom property to the event.
If the total added properties exceed MAX_TOTAL_PROPERTIES_SIZE
in size it will cause the event
to be invalid.
name | The property name. |
---|---|
value | A property value. |
Adds a custom property to the event.
If the total number of properties exceed MAX_TOTAL_PROPERTIES_SIZE
it will cause the event
to be invalid.
name | The property name. |
---|---|
value | The property value. |
Adds a custom property to the event.
If the total added properties exceed MAX_TOTAL_PROPERTIES_SIZE
in size it will cause the event
to be invalid.
name | The property name. |
---|---|
value | The property value. |
Adds a custom property to the event.
If the total number of properties exceed MAX_TOTAL_PROPERTIES_SIZE
it will cause the event
to be invalid.
name | The property name. |
---|---|
value | The property value. |
NumberFormatException | if the value is infinite or not a number |
---|
Adds a custom property to the event.
If the total added properties exceed MAX_TOTAL_PROPERTIES_SIZE
in size it will cause the event
to be invalid.
name | The property name. |
---|---|
value | The property value. |
Adds a custom property to the event.
If the total added properties exceed MAX_TOTAL_PROPERTIES_SIZE
in size it will cause the event
to be invalid.
name | The property name. |
---|---|
value | The property value. |
Sets the event value.
The event's value will be accurate 6 digits after the decimal. The number must fall in the range [-2^31, 2^31-1]. Any value outside that range will cause the event to be invalid.
value | The event's value as a double |
---|
NumberFormatException | if the value is infinity or not a number. |
---|
Sets the event value.
value | The event's value as an int. |
---|
Sets the event value from a String.
The event's value will be accurate 6 digits after the decimal. The number must fall in the range [-2^31, 2^31-1]. Any value outside that range will cause the event to be invalid.
value | The event's value as a String. |
---|
NumberFormatException | if the event value does not contain a valid string representation of a big decimal. |
---|
Sets the event value.
The event's value will be accurate 6 digits after the decimal. The number must fall in the range [-2^31, 2^31-1]. Any value outside that range will cause the event to be invalid.
value | The event's value as a BigDecimal. |
---|
Sets the interaction type and ID for the event.
If any non-property field exceeds MAX_CHARACTER_LENGTH
characters it will cause the event to be invalid.
interactionType | The event's interaction type. |
---|---|
interactionId | The event's interaction ID. |
Sets the interaction type and ID from a Message Center message.
richPushMessageId | The rich push message ID that created the custom event. |
---|
Sets a JsonMap representing the event properties.
If the total added properties exceed MAX_TOTAL_PROPERTIES_SIZE
in size it will cause the event
to be invalid.
properties | A JsonMap of the event's properties. |
---|
Sets the transaction ID.
If the transaction ID exceeds MAX_CHARACTER_LENGTH
characters it will cause the event to be invalid.
transactionId | The event's transaction ID. |
---|