public class MpnBuilder
extends java.lang.Object
MpnSubscription.setNotificationFormat(String).| Constructor and Description |
|---|
MpnBuilder()
Creates an empty object to be used to create a push notification format from scratch.
Use setters methods to set the value of push notification fields. |
MpnBuilder(java.lang.String notificationFormat)
Creates an object based on the specified push notification format.
Use getter methods to obtain the value of push notification fields. |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
body()
Gets the value of
notification.body field. |
MpnBuilder |
body(java.lang.String body)
Sets the
notification.body field. |
java.util.List<java.lang.String> |
bodyLocArguments()
Gets the value of
notification.body_loc_args field. |
MpnBuilder |
bodyLocArguments(java.util.List<java.lang.String> bodyLocArguments)
Sets the
notification.body_loc_args field. |
java.lang.String |
bodyLocKey()
Gets the value of
notification.body_loc_key field. |
MpnBuilder |
bodyLocKey(java.lang.String bodyLocKey)
Sets the
notification.body_loc_key field. |
java.lang.String |
build()
Produces the JSON structure for the push notification format specified by this object.
|
java.lang.String |
clickAction()
Gets the value of
notification.click_action field. |
MpnBuilder |
clickAction(java.lang.String clickAction)
Sets the
notification.click_action field. |
java.lang.String |
collapseKey()
Gets the value of
collapse_key field. |
MpnBuilder |
collapseKey(java.lang.String collapseKey)
Sets the
collapse_key field. |
java.lang.String |
color()
Gets the value of
notification.color field. |
MpnBuilder |
color(java.lang.String color)
Sets the
notification.color field. |
MpnBuilder |
contentAvailable(java.lang.Boolean contentAvailable)
Sets the
content_available field with a boolean value. |
MpnBuilder |
contentAvailable(java.lang.String contentAvailable)
Sets the
content_available field with a string value. |
java.lang.Boolean |
contentAvailableAsBoolean()
Gets the value of
content_available field as a boolean. |
java.lang.String |
contentAvailableAsString()
Gets the value of
content_available field as a string. |
java.util.Map<java.lang.String,java.lang.String> |
data()
Gets sub-fields of the
data field. |
MpnBuilder |
data(java.util.Map<java.lang.String,java.lang.String> data)
Sets sub-fields of the
data field. |
java.lang.String |
icon()
Gets the value of
notification.icon field. |
MpnBuilder |
icon(java.lang.String icon)
Sets the
notification.icon field. |
java.lang.String |
priority()
Gets the value of
priority field. |
MpnBuilder |
priority(java.lang.String priority)
Sets the
priority field. |
java.lang.String |
sound()
Gets the value of
notification.sound field. |
MpnBuilder |
sound(java.lang.String sound)
Sets the
notification.sound field. |
java.lang.String |
tag()
Gets the value of
notification.tag field. |
MpnBuilder |
tag(java.lang.String tag)
Sets the
notification.tag field. |
MpnBuilder |
timeToLive(java.lang.Integer timeToLive)
Sets the
time_to_live field with an integer value. |
MpnBuilder |
timeToLive(java.lang.String timeToLive)
Sets the
time_to_live field with a string value. |
java.lang.Integer |
timeToLiveAsInteger()
Gets the value of
time_to_live field as an integer. |
java.lang.String |
timeToLiveAsString()
Gets the value of
time_to_live field as a string. |
java.lang.String |
title()
Gets the value of
notification.title field. |
MpnBuilder |
title(java.lang.String title)
Sets the
notification.title field. |
java.util.List<java.lang.String> |
titleLocArguments()
Gets the value of
notification.title_loc_args field. |
MpnBuilder |
titleLocArguments(java.util.List<java.lang.String> titleLocArguments)
Sets the
notification.title_loc_args field. |
java.lang.String |
titleLocKey()
Gets the value of
notification.title_loc_key field. |
MpnBuilder |
titleLocKey(java.lang.String titleLocKey)
Sets the
notification.title_loc_key field. |
public MpnBuilder()
public MpnBuilder(@Nonnull
java.lang.String notificationFormat)
notificationFormat - A JSON structure representing a push notification format.java.lang.IllegalArgumentException - if the notification is not a valid JSON structure.@Nonnull public java.lang.String build()
public MpnBuilder collapseKey(java.lang.String collapseKey)
collapse_key field.collapseKey - A string to be used for the collapse_key field value, or null to clear it.public java.lang.String collapseKey()
collapse_key field.collapse_key field, or null if absent.public MpnBuilder priority(java.lang.String priority)
priority field.priority - A string to be used for the priority field value, or null to clear it.public java.lang.String priority()
priority field.priority field, or null if absent.public MpnBuilder contentAvailable(java.lang.String contentAvailable)
content_available field with a string value.contentAvailable - A string to be used for the content_available field value, or null to clear it.public java.lang.String contentAvailableAsString()
content_available field as a string.content_available field, or null if absent.public MpnBuilder contentAvailable(java.lang.Boolean contentAvailable)
content_available field with a boolean value.contentAvailable - A boolean to be used for the content_available field value, or null to clear it.public java.lang.Boolean contentAvailableAsBoolean()
content_available field as a boolean.content_available field, or null if absent.public MpnBuilder timeToLive(java.lang.String timeToLive)
time_to_live field with a string value.timeToLive - A string to be used for the time_to_live field value, or null to clear it.public java.lang.String timeToLiveAsString()
time_to_live field as a string.time_to_live field, or null if absent.public MpnBuilder timeToLive(java.lang.Integer timeToLive)
time_to_live field with an integer value.timeToLive - An integer to be used for the time_to_live field value, or null to clear it.public java.lang.Integer timeToLiveAsInteger()
time_to_live field as an integer.time_to_live field, or null if absent.public MpnBuilder title(java.lang.String title)
notification.title field.title - A string to be used for the notification.title field value, or null to clear it.public java.lang.String title()
notification.title field.notification.title field, or null if absent.public MpnBuilder titleLocKey(java.lang.String titleLocKey)
notification.title_loc_key field.titleLocKey - A string to be used for the notification.title_loc_key field value, or null to clear it.public java.lang.String titleLocKey()
notification.title_loc_key field.notification.title_loc_key field, or null if absent.public MpnBuilder titleLocArguments(java.util.List<java.lang.String> titleLocArguments)
notification.title_loc_args field.titleLocArguments - A list of strings to be used for the notification.title_loc_args field value, or null to clear it.public java.util.List<java.lang.String> titleLocArguments()
notification.title_loc_args field.notification.title_loc_args field, or null if absent.public MpnBuilder body(java.lang.String body)
notification.body field.body - A string to be used for the notification.body field value, or null to clear it.public java.lang.String body()
notification.body field.notification.body field, or null if absent.public MpnBuilder bodyLocKey(java.lang.String bodyLocKey)
notification.body_loc_key field.bodyLocKey - A string to be used for the notification.body_loc_key field value, or null to clear it.public java.lang.String bodyLocKey()
notification.body_loc_key field.notification.body_loc_key field, or null if absent.public MpnBuilder bodyLocArguments(java.util.List<java.lang.String> bodyLocArguments)
notification.body_loc_args field.bodyLocArguments - A list of strings to be used for the notification.body_loc_args field value, or null to clear it.public java.util.List<java.lang.String> bodyLocArguments()
notification.body_loc_args field.notification.body_loc_args field, or null if absent.public MpnBuilder icon(java.lang.String icon)
notification.icon field.icon - A string to be used for the notification.icon field value, or null to clear it.public java.lang.String icon()
notification.icon field.notification.icon field, or null if absent.public MpnBuilder sound(java.lang.String sound)
notification.sound field.sound - A string to be used for the notification.sound field value, or null to clear it.public java.lang.String sound()
notification.sound field.notification.sound field, or null if absent.public MpnBuilder tag(java.lang.String tag)
notification.tag field.tag - A string to be used for the notification.tag field value, or null to clear it.public java.lang.String tag()
notification.tag field.notification.tag field, or null if absent.public MpnBuilder color(java.lang.String color)
notification.color field.color - A string to be used for the notification.color field value, or null to clear it.public java.lang.String color()
notification.color field.notification.color field, or null if absent.public MpnBuilder clickAction(java.lang.String clickAction)
notification.click_action field.clickAction - A string to be used for the notification.click_action field value, or null to clear it.public java.lang.String clickAction()
notification.click_action field.notification.click_action field, or null if absent.public MpnBuilder data(java.util.Map<java.lang.String,java.lang.String> data)
data field.data - A map to be used for sub-fields of the data field, or null to clear it.public java.util.Map<java.lang.String,java.lang.String> data()
data field.data field, or null if absent.