java.lang.Object | |
↳ | com.urbanairship.analytics.CustomEvent.Builder |
Builder class for CustomEvent
Objects.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
CustomEvent.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 |
addEvent()
Create the custom event and adds the event to Analytics.
| ||||||||||
CustomEvent.Builder |
addProperty(String name, int value)
Adds a custom property to the event.
| ||||||||||
CustomEvent.Builder |
addProperty(String name, long 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, Collection<String> 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, boolean value)
Adds a custom property to the event.
| ||||||||||
CustomEvent |
create()
Creates the custom event.
| ||||||||||
CustomEvent.Builder |
setEventValue(int value)
Sets the event value.
| ||||||||||
CustomEvent.Builder |
setEventValue(BigDecimal value)
Sets the event value.
| ||||||||||
CustomEvent.Builder |
setEventValue(String value)
Sets the event value from a String.
| ||||||||||
CustomEvent.Builder |
setEventValue(double value)
Sets the event value.
| ||||||||||
CustomEvent.Builder |
setInteraction(RichPushMessage message)
Sets the interaction type and ID from a
RichPushMessage . | ||||||||||
CustomEvent.Builder |
setInteraction(String interactionType, String interactionId)
Sets the interaction type and ID for the event.
| ||||||||||
CustomEvent.Builder |
setTransactionId(String transactionId)
Sets the transaction ID.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
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. |
---|
Create the custom event and adds the event to Analytics.
Adds a custom property to the event.
If the max number of properties exceedsMAX_PROPERTIES
, or if the name of the
property exceeds MAX_CHARACTER_LENGTH
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 max number of properties exceedsMAX_PROPERTIES
, or if the name of the
property exceeds MAX_CHARACTER_LENGTH
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 max number of properties exceedsMAX_PROPERTIES
, or if the name of the
property exceeds MAX_CHARACTER_LENGTH
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 max number of properties exceedsMAX_PROPERTIES
, if the name of the
property, or any of the Strings within its value exceeds MAX_CHARACTER_LENGTH
, or
if the value contains more than MAX_PROPERTY_COLLECTION_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 max number of properties exceedsMAX_PROPERTIES
, or if the name or value
of the property exceeds MAX_CHARACTER_LENGTH
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 max number of properties exceedsMAX_PROPERTIES
, or if the name of the
property exceeds MAX_CHARACTER_LENGTH
it will cause the event to be invalid.name | The property name. |
---|---|
value | The property value. |
Sets the event value.
value | The event's value as an int. |
---|
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 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 double |
---|
NumberFormatException | if the value is infinity or not a number. |
---|
Sets the interaction type and ID from a RichPushMessage
.
message | The rich push message that created the custom event. |
---|
Sets the interaction type and ID for the event.
If any field exceeds 255 characters it will cause the event to be invalid.interactionType | The event's interaction type. |
---|---|
interactionId | The event's interaction ID. |
Sets the transaction ID.
If the transaction ID exceeds 255 characters it will cause the event to be invalid.transactionId | The event's transaction ID. |
---|