public class

MediaEventTemplate

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

Class Overview

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

Summary

Constants
String BROWSED_CONTENT_EVENT The browsed event name.
String CONSUMED_CONTENT_EVENT The consumed_content event name.
String MEDIA_EVENT_TEMPLATE The media event template type.
String SHARED_CONTENT_EVENT The shared_content event name.
String STARRED_CONTENT_EVENT The starred_content event name.
Public Methods
CustomEvent createEvent()
Creates the custom media event.
static MediaEventTemplate newBrowsedTemplate()
Creates a browsed event template.
static MediaEventTemplate newConsumedTemplate(int value)
Creates a consumed content event template.
static MediaEventTemplate newConsumedTemplate(BigDecimal value)
Creates a consumed content event template.
static MediaEventTemplate newConsumedTemplate(double value)
Creates a consumed content event template.
static MediaEventTemplate newConsumedTemplate(String value)
Creates a consumed content event template.
static MediaEventTemplate newConsumedTemplate()
Creates a consumed content event template.
static MediaEventTemplate newSharedTemplate()
Creates a shared content event template.
static MediaEventTemplate newSharedTemplate(String source, String medium)
Creates a shared content event template.
static MediaEventTemplate newStarredTemplate()
Creates a starred content event template.
MediaEventTemplate setAuthor(String author)
Set the author.
MediaEventTemplate setCategory(String category)
Set the category.
MediaEventTemplate setDescription(String description)
Set the description.
MediaEventTemplate setFeature(boolean feature)
Set the feature.
MediaEventTemplate setId(String id)
Set the ID.
MediaEventTemplate setPublishedDate(String publishedDate)
Set the publishedDate.
MediaEventTemplate setType(String type)
Set the type.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String BROWSED_CONTENT_EVENT

The browsed event name.

Constant Value: "browsed_content"

public static final String CONSUMED_CONTENT_EVENT

The consumed_content event name.

Constant Value: "consumed_content"

public static final String MEDIA_EVENT_TEMPLATE

The media event template type.

Constant Value: "media"

public static final String SHARED_CONTENT_EVENT

The shared_content event name.

Constant Value: "shared_content"

public static final String STARRED_CONTENT_EVENT

The starred_content event name.

Constant Value: "starred_content"

Public Methods

public CustomEvent createEvent ()

Creates the custom media event.

Returns
  • The custom media event.

public static MediaEventTemplate newBrowsedTemplate ()

Creates a browsed event template.

Returns
  • A MediaEventTemplate.

public static MediaEventTemplate newConsumedTemplate (int value)

Creates a consumed content event template.

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 value as an int.
Returns
  • A MediaEventTemplate.

public static MediaEventTemplate newConsumedTemplate (BigDecimal value)

Creates a consumed content event template.

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 value as a BigDecimal.
Returns
  • A MediaEventTemplate.

public static MediaEventTemplate newConsumedTemplate (double value)

Creates a consumed content event template.

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 value as a double. Must be a number.
Returns
  • A MediaEventTemplate.
Throws
NumberFormatException if the value is infinity or not a number.

public static MediaEventTemplate newConsumedTemplate (String value)

Creates a consumed content event template.

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 value as a string. Must contain valid string representation of a big decimal.
Returns
  • A MediaEventTemplate.
Throws
NumberFormatException if the event value does not contain a valid string representation of a big decimal.

public static MediaEventTemplate newConsumedTemplate ()

Creates a consumed content event template.

Returns
  • A MediaEventTemplate.

public static MediaEventTemplate newSharedTemplate ()

Creates a shared content event template.

Returns
  • A MediaEventTemplate.

public static MediaEventTemplate newSharedTemplate (String source, String medium)

Creates a shared content event template.

If the source or medium exceeds 255 characters it will cause the event to be invalid.

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

public static MediaEventTemplate newStarredTemplate ()

Creates a starred content event template.

Returns
  • A MediaEventTemplate.

public MediaEventTemplate setAuthor (String author)

Set the author.

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

Parameters
author The author as a string.
Returns
  • A MediaEventTemplate.

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

public MediaEventTemplate setDescription (String description)

Set the description.

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

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

public MediaEventTemplate setFeature (boolean feature)

Set the feature.

Parameters
feature The feature as a boolean.
Returns
  • A MediaEventTemplate.

public MediaEventTemplate setId (String id)

Set the ID.

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

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

public MediaEventTemplate setPublishedDate (String publishedDate)

Set the publishedDate.

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

Parameters
publishedDate The publishedDate as a string.
Returns
  • A MediaEventTemplate.

public MediaEventTemplate setType (String type)

Set the type.

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

Parameters
type The type as a string.
Returns
  • A MediaEventTemplate.