public static class

ButtonInfo.Builder

extends Object
java.lang.Object
   ↳ com.urbanairship.iam.ButtonInfo.Builder

Class Overview

Button info builder class.

Summary

Public Methods
ButtonInfo.Builder addAction(String actionName, JsonSerializable actionValue)
Adds a action to run when the button is clicked.
ButtonInfo build(Boolean enforceMaxIdLength)
Builds the button info.
ButtonInfo build()
Builds the button info.
ButtonInfo.Builder setActions(Map<StringJsonValue> actions)
Sets the actions to run when the button is clicked.
ButtonInfo.Builder setBackgroundColor(int backgroundColor)
Sets the button's background color.
ButtonInfo.Builder setBehavior(String behavior)
Sets the button behavior.
ButtonInfo.Builder setBorderColor(int borderColor)
Sets the button's border color.
ButtonInfo.Builder setBorderRadius(float borderRadius)
Sets the border radius in dps.
ButtonInfo.Builder setId(String id)
Sets the button's ID used for reporting events.
ButtonInfo.Builder setLabel(TextInfo label)
Sets the button's label text info.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public ButtonInfo.Builder addAction (String actionName, JsonSerializable actionValue)

Adds a action to run when the button is clicked.

Parameters
actionName The action name.
actionValue The action value.
Returns
  • The builder instance.

public ButtonInfo build (Boolean enforceMaxIdLength)

Builds the button info.

Parameters
enforceMaxIdLength true to enforce the max ID length, otherwise false.
Returns
  • The button info.
Throws
IllegalArgumentException If the ButtonInfo fails to pass validation checks.

public ButtonInfo build ()

Builds the button info.

Returns
  • The button info.
Throws
IllegalArgumentException If the ButtonInfo fails to pass validation checks.

public ButtonInfo.Builder setActions (Map<StringJsonValue> actions)

Sets the actions to run when the button is clicked.

Parameters
actions The button's actions.
Returns
  • The builder instance.

public ButtonInfo.Builder setBackgroundColor (int backgroundColor)

Sets the button's background color. Defaults to transparent.

Parameters
backgroundColor The background color.
Returns
  • The builder instance.

public ButtonInfo.Builder setBehavior (String behavior)

Sets the button behavior. Defaults to BEHAVIOR_DISMISS.

Parameters
behavior The button's behavior.
Returns
  • The builder instance.

public ButtonInfo.Builder setBorderColor (int borderColor)

Sets the button's border color. Defaults to transparent.

Parameters
borderColor The border color.
Returns
  • The builder instance.

public ButtonInfo.Builder setBorderRadius (float borderRadius)

Sets the border radius in dps. Defaults to 0.

Parameters
borderRadius The border radius.
Returns
  • The builder instance.

public ButtonInfo.Builder setId (String id)

Sets the button's ID used for reporting events.

Parameters
id The button's ID.
Returns
  • The builder instance.

public ButtonInfo.Builder setLabel (TextInfo label)

Sets the button's label text info.

Parameters
label The button's label text info.
Returns
  • The builder instance.