public class

BannerDisplayContent

extends Object
implements DisplayContent
java.lang.Object
   ↳ com.urbanairship.iam.banner.BannerDisplayContent

Class Overview

Display content for a TYPE_BANNER in-app message.

Summary

Nested Classes
class BannerDisplayContent.Builder Banner Display Content Builder. 
@interface BannerDisplayContent.Placement  
@interface BannerDisplayContent.Template  
Constants
long DEFAULT_DURATION_MS Default duration in milliseconds.
int MAX_BUTTONS Maximum number of buttons supported by a banner.
String PLACEMENT_BOTTOM Display the message on bottom of the screen.
String PLACEMENT_TOP Display the message on top of the screen.
String TEMPLATE_LEFT_MEDIA Template to display the optional media on the left.
String TEMPLATE_RIGHT_MEDIA Template to display the optional media on the right.
[Expand]
Inherited Constants
From interface com.urbanairship.iam.DisplayContent
Public Methods
boolean equals(Object o)
static BannerDisplayContent fromJson(JsonValue value)
Parses banner display JSON.
Map<StringJsonValue> getActions()
Returns the action names and values to be run when the banner is clicked.
int getBackgroundColor()
Returns the banner background color.
TextInfo getBody()
Returns the optional body TextInfo.
float getBorderRadius()
Returns the border radius in dps.
String getButtonLayout()
Returns the button layout.
List<ButtonInfo> getButtons()
Returns the list of optional buttons.
int getDismissButtonColor()
Returns the banner dismiss button color.
long getDuration()
Returns the banner display duration.
TextInfo getHeading()
Returns the optional heading TextInfo.
MediaInfo getMedia()
Returns the optional MediaInfo.
String getPlacement()
Returns the banner placement.
String getTemplate()
Returns the banner template.
int hashCode()
static BannerDisplayContent.Builder newBuilder()
Builder factory method.
static BannerDisplayContent.Builder newBuilder(BannerDisplayContent displayContent)
Creates a builder from existing display content.
JsonValue toJsonValue()
Returns the objects represented as a JsonValue.
String toString()
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.urbanairship.json.JsonSerializable

Constants

public static final long DEFAULT_DURATION_MS

Default duration in milliseconds.

Constant Value: 15000 (0x0000000000003a98)

public static final int MAX_BUTTONS

Maximum number of buttons supported by a banner.

Constant Value: 2 (0x00000002)

public static final String PLACEMENT_BOTTOM

Display the message on bottom of the screen.

Constant Value: "bottom"

public static final String PLACEMENT_TOP

Display the message on top of the screen.

Constant Value: "top"

public static final String TEMPLATE_LEFT_MEDIA

Template to display the optional media on the left.

Constant Value: "media_left"

public static final String TEMPLATE_RIGHT_MEDIA

Template to display the optional media on the right.

Constant Value: "media_right"

Public Methods

public boolean equals (Object o)

public static BannerDisplayContent fromJson (JsonValue value)

Parses banner display JSON.

Parameters
value The json payload.
Returns
  • The parsed banner display content.
Throws
JsonException If the json was unable to be parsed.

public Map<StringJsonValue> getActions ()

Returns the action names and values to be run when the banner is clicked.

Returns
  • The action map.

public int getBackgroundColor ()

Returns the banner background color.

Returns
  • The banner background color.

public TextInfo getBody ()

Returns the optional body TextInfo.

Returns
  • The banner body.

public float getBorderRadius ()

Returns the border radius in dps.

Returns
  • Border radius in dps.

public String getButtonLayout ()

Returns the button layout.

Returns
  • The button layout.

public List<ButtonInfo> getButtons ()

Returns the list of optional buttons.

Returns
  • A list of buttons.

public int getDismissButtonColor ()

Returns the banner dismiss button color.

Returns
  • The banner dismiss button color.

public long getDuration ()

Returns the banner display duration.

Returns
  • The banner display duration.

public TextInfo getHeading ()

Returns the optional heading TextInfo.

Returns
  • The banner heading.

public MediaInfo getMedia ()

Returns the optional MediaInfo.

Returns
  • The banner media.

public String getPlacement ()

Returns the banner placement.

Returns
  • The banner placement.

public String getTemplate ()

Returns the banner template.

Returns
  • The banner template.

public int hashCode ()

public static BannerDisplayContent.Builder newBuilder ()

Builder factory method.

Returns
  • A builder instance.

public static BannerDisplayContent.Builder newBuilder (BannerDisplayContent displayContent)

Creates a builder from existing display content.

Parameters
displayContent The display content.
Returns
  • A builder instance.

public JsonValue toJsonValue ()

Returns the objects represented as a JsonValue.

Returns
  • The object as a JsonValue.

public String toString ()