Enum Class PushNotificationParameters
- All Implemented Interfaces:
Serializable
,Comparable<PushNotificationParameters>
,Constable
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
Enum Constant Summary
Enum ConstantDescriptionRequired message or text of the push notification, a maximum of 5000 characters.Optional icon, and if specified, must be an SVG icon.Optional icon color.Optional picture to display with the notification.Required private or alias key for authentication each time a push notification is sent.Required origin of the notification, generally an IP address.Optional priority determining where the push notification will be put in the list of notifications (this sorting generally applies to Android devices only).Required sender device identification.Optional sound to play when notification arrives.Notification title (required).Optional URL.Optional URL title, if this parameter is specified, the URL will serve as it.How often the device should vibrate when receiving a push-notification (optional).Field Summary
Modifier and TypeFieldDescriptionfinal boolean
Required flag.final String
The parameter name (as in name=value).Method Summary
Modifier and TypeMethodDescriptionstatic Map<PushNotificationParameters,
String> Parses an encoded URL query string into a parameter array with its values.toString()
Formats the parameter as a string as PARAM["name",{required|optional}].static Map<PushNotificationParameters,
String> Validates a map of push notification parameters.static PushNotificationParameters
Returns the enum constant of this class with the specified name.static PushNotificationParameters[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
Enum Constant Details
TITLE
Notification title (required).Server side accepted values are
String
.BODY
Required message or text of the push notification, a maximum of 5000 characters. The push notification will show fewer characters depending on the system.Server side accepted values are
String
.SOUND
Optional sound to play when notification arrives.Server side accepted values are
Integer
.VIBRATION
How often the device should vibrate when receiving a push-notification (optional). "0" or undefined = device default or a number "1" to "3".This parameter are generally only available for clients on iOS and Android.
Server side accepted values are
Integer
orString
, integer values 0 to 3.ICON
Optional icon, and if specified, must be an SVG icon.Server side accepted values are
String
.ICON_COLOR
Optional icon color.Server side accepted values are
Color
orString
encoded as "#RGB" or "#RRGGBB". The leading '#' can be omitted.URL
Optional URL.Server side accepted values are
URL
,URI
orString
.URL_TITLE
Optional URL title, if this parameter is specified, the URL will serve as it.Server side accepted values are
String
.IMAGE
Optional picture to display with the notification.Server side accepted values are
File
orString
.PRIORITY
Optional priority determining where the push notification will be put in the list of notifications (this sorting generally applies to Android devices only).Server side accepted values are
Integer
orString
, integer value ranges from -2 = lowest priority to 2 = highest priority, default being zero or normal priority.SENDER
Required sender device identification.Server side accepted values are
String
.ORIGIN
Required origin of the notification, generally an IP address.Server side accepted values are
InetAddress
andString
.KEY_ALIAS
Required private or alias key for authentication each time a push notification is sent.Server side accepted values are
String
.
Field Details
name
The parameter name (as in name=value).isRequired
public final boolean isRequiredRequired flag.
Method Details
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
toString
Formats the parameter as a string as PARAM["name",{required|optional}].- Overrides:
toString
in classEnum<PushNotificationParameters>
- Returns:
- A formatted string.
parseURL
Parses an encoded URL query string into a parameter array with its values.- Parameters:
query
- The query string.- Returns:
- A new validated map of parameters. Values in the map are trimmed for white spaces.
- Throws:
IllegalArgumentException
- If an argument is invalid.
validateParams
public static Map<PushNotificationParameters,String> validateParams(Map<PushNotificationParameters, String> params) Validates a map of push notification parameters.- Parameters:
params
- The map of parameters.- Returns:
- The map of parameters
params
argument. - Throws:
IllegalArgumentException
- If a required parameter is not present.