public class

RetailEventTemplate

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

Class Overview

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

Summary

Constants
String ADDED_TO_CART_EVENT The added_to_cart event name.
String BROWSED_PRODUCT_EVENT The browsed event name.
String PURCHASED_EVENT The purchased event name.
String RETAIL_EVENT_TEMPLATE The retail event template type.
String SHARED_PRODUCT_EVENT The shared_product event name.
String STARRED_PRODUCT_EVENT The starred_product event name.
String WISHLIST_EVENT The wishlist event name.
Public Methods
CustomEvent createEvent()
Creates the custom retail event.
static RetailEventTemplate newAddedToCartTemplate()
Creates an added to cart event template.
static RetailEventTemplate newBrowsedTemplate()
Creates a browsed event template.
static RetailEventTemplate newPurchasedTemplate()
Creates a purchased event template.
static RetailEventTemplate newSharedProductTemplate(String source, String medium)
Creates a shared product event template.
static RetailEventTemplate newSharedProductTemplate()
Creates a shared product event template.
static RetailEventTemplate newStarredProductTemplate()
Creates a starred product event template.
static RetailEventTemplate newWishlishTemplate(String name, String id)
This method is deprecated. Use newWishlistTemplate(String, String). This method will be removed in a future release.
static RetailEventTemplate newWishlishTemplate()
This method is deprecated. Use newWishlistTemplate(). This method will be removed in a future release.
static RetailEventTemplate newWishlistTemplate()
Creates a wishlist event template.
static RetailEventTemplate newWishlistTemplate(String name, String id)
Creates a wishlist event template.
RetailEventTemplate setBrand(String brand)
Set the brand.
RetailEventTemplate setCategory(String category)
Set the category.
RetailEventTemplate setDescription(String description)
Set the description.
RetailEventTemplate setId(String id)
Set the ID.
RetailEventTemplate setNewItem(boolean newItem)
Set the newItem value.
RetailEventTemplate setTransactionId(String transactionId)
Set the transaction ID.
RetailEventTemplate setValue(double value)
Sets the event value.
RetailEventTemplate setValue(String value)
Sets the event value.
RetailEventTemplate setValue(int value)
Sets the event value.
RetailEventTemplate setValue(BigDecimal value)
Sets the event value.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String ADDED_TO_CART_EVENT

The added_to_cart event name.

Constant Value: "added_to_cart"

public static final String BROWSED_PRODUCT_EVENT

The browsed event name.

Constant Value: "browsed"

public static final String PURCHASED_EVENT

The purchased event name.

Constant Value: "purchased"

public static final String RETAIL_EVENT_TEMPLATE

The retail event template type.

Constant Value: "retail"

public static final String SHARED_PRODUCT_EVENT

The shared_product event name.

Constant Value: "shared_product"

public static final String STARRED_PRODUCT_EVENT

The starred_product event name.

Constant Value: "starred_product"

public static final String WISHLIST_EVENT

The wishlist event name.

Constant Value: "wishlist"

Public Methods

public CustomEvent createEvent ()

Creates the custom retail event.

Returns
  • The custom retail event.

public static RetailEventTemplate newAddedToCartTemplate ()

Creates an added to cart event template.

Returns
  • A RetailEventTemplate.

public static RetailEventTemplate newBrowsedTemplate ()

Creates a browsed event template.

Returns
  • A RetailEventTemplate.

public static RetailEventTemplate newPurchasedTemplate ()

Creates a purchased event template.

Returns
  • A RetailEventTemplate.

public static RetailEventTemplate newSharedProductTemplate (String source, String medium)

Creates a shared product event template.

Parameters
source The source as a string.
medium The medium as a string.
Returns
  • A RetailEventTemplate.

public static RetailEventTemplate newSharedProductTemplate ()

Creates a shared product event template.

Returns
  • A RetailEventTemplate.

public static RetailEventTemplate newStarredProductTemplate ()

Creates a starred product event template.

Returns
  • A RetailEventTemplate.

public static RetailEventTemplate newWishlishTemplate (String name, String id)

This method is deprecated.
Use newWishlistTemplate(String, String). This method will be removed in a future release.

Creates a wishlist event template.

Parameters
name The wishlist name.
id The wishlist ID.
Returns
  • A RetailEventTemplate.

public static RetailEventTemplate newWishlishTemplate ()

This method is deprecated.
Use newWishlistTemplate(). This method will be removed in a future release.

Creates a wishlist event template.

Returns
  • A RetailEventTemplate.

public static RetailEventTemplate newWishlistTemplate ()

Creates a wishlist event template.

Returns
  • A RetailEventTemplate.

public static RetailEventTemplate newWishlistTemplate (String name, String id)

Creates a wishlist event template.

Parameters
name The wishlist name.
id The wishlist ID.
Returns
  • A RetailEventTemplate.

public RetailEventTemplate setBrand (String brand)

Set the brand.

Parameters
brand The brand as a string.
Returns
  • A RetailEventTemplate.

public RetailEventTemplate setCategory (String category)

Set the category.

Parameters
category The category as a string.
Returns
  • A RetailEventTemplate.

public RetailEventTemplate setDescription (String description)

Set the description.

Parameters
description The description as a string.
Returns
  • A RetailEventTemplate.

public RetailEventTemplate setId (String id)

Set the ID.

Parameters
id The ID as a string.
Returns
  • A RetailEventTemplate.

public RetailEventTemplate setNewItem (boolean newItem)

Set the newItem value.

Parameters
newItem A boolean value indicating if the item is new or not.
Returns
  • A RetailEventTemplate.

public RetailEventTemplate 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
  • A RetailEventTemplate.

public RetailEventTemplate 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
  • A RetailEventTemplate.
Throws
NumberFormatException if the value is infinity or not a number.

public RetailEventTemplate 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 RetailEventTemplate.
Throws
NumberFormatException if the event value does not contain a valid string representation of a big decimal.

public RetailEventTemplate 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 RetailEventTemplate.

public RetailEventTemplate 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
  • A RetailEventTemplate.