public class

AccountEventTemplate

extends Object
java.lang.Object
   ↳ com.urbanairship.analytics.AccountEventTemplate

Class Overview

A class that represents a custom account event template for the application.

Summary

Constants
String ACCOUNT_EVENT_TEMPLATE The account event template type.
String REGISTERED_ACCOUNT_EVENT The registered account event name.
Public Methods
CustomEvent createEvent()
Creates the custom account event.
static AccountEventTemplate newRegisteredTemplate()
Creates a registered account event template.
AccountEventTemplate setCategory(String category)
Set the category.
AccountEventTemplate setTransactionId(String transactionId)
Set the transaction ID.
AccountEventTemplate setValue(int value)
Sets the event value.
AccountEventTemplate setValue(double value)
Sets the event value.
AccountEventTemplate setValue(String value)
Sets the event value.
AccountEventTemplate setValue(BigDecimal value)
Sets the event value.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String ACCOUNT_EVENT_TEMPLATE

The account event template type.

Constant Value: "account"

public static final String REGISTERED_ACCOUNT_EVENT

The registered account event name.

Constant Value: "registered_account"

Public Methods

public CustomEvent createEvent ()

Creates the custom account event.

Returns
  • The custom account event.

public static AccountEventTemplate newRegisteredTemplate ()

Creates a registered account event template.

Returns
  • An AccountEventTemplate.

public AccountEventTemplate setCategory (String category)

Set the category.

If the category exceeds 255 characters it will cause the event to be invalid.

Parameters
category The category as a string.
Returns
  • An AccountEventTemplate.

public AccountEventTemplate setTransactionId (String transactionId)

Set the transaction ID.

If the transaction ID exceeds 255 characters it will cause the event to be invalid.

Parameters
transactionId The event's transaction ID as a string.
Returns
  • An AccountEventTemplate.

public AccountEventTemplate setValue (int 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.

Parameters
value The event's value as an int.
Returns
  • An AccountEventTemplate.

public AccountEventTemplate setValue (double 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.

Parameters
value The event's value as a double. Must be a number.
Returns
  • An AccountEventTemplate.
Throws
NumberFormatException if the value is infinity or not a number.

public AccountEventTemplate setValue (String 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.

Parameters
value The event's value as a string. Must contain valid string representation of a big decimal.
Returns
  • An AccountEventTemplate.
Throws
NumberFormatException if the event value does not contain a valid string representation of a big decimal.

public AccountEventTemplate setValue (BigDecimal 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.

Parameters
value The event's value as a BigDecimal.
Returns
  • An AccountEventTemplate.