Enum Class PushNotificationParameters

java.lang.Object
java.lang.Enum<PushNotificationParameters>
com.iizix.push.PushNotificationParameters
All Implemented Interfaces:
Serializable, Comparable<PushNotificationParameters>, Constable

public enum PushNotificationParameters extends Enum<PushNotificationParameters>
The enum used for push notification parameters and if they can be omitted.
  • Enum Constant Details

    • TITLE

      public static final PushNotificationParameters TITLE
      Notification title (required).

      Server side accepted values are String.

    • BODY

      public static final PushNotificationParameters 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

      public static final PushNotificationParameters SOUND
      Optional sound to play when notification arrives.

      Server side accepted values are Integer.

    • VIBRATION

      public static final PushNotificationParameters 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 or String, integer values 0 to 3.

    • ICON

      public static final PushNotificationParameters ICON
      Optional icon, and if specified, must be an SVG icon.

      Server side accepted values are String.

    • ICON_COLOR

      public static final PushNotificationParameters ICON_COLOR
      Optional icon color.

      Server side accepted values are Color or String encoded as "#RGB" or "#RRGGBB". The leading '#' can be omitted.

    • URL

      public static final PushNotificationParameters URL
      Optional URL.

      Server side accepted values are URL, URI or String.

    • URL_TITLE

      public static final PushNotificationParameters URL_TITLE
      Optional URL title, if this parameter is specified, the URL will serve as it.

      Server side accepted values are String.

    • IMAGE

      public static final PushNotificationParameters IMAGE
      Optional picture to display with the notification.

      Server side accepted values are File or String.

    • PRIORITY

      public static final PushNotificationParameters 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 or String, integer value ranges from -2 = lowest priority to 2 = highest priority, default being zero or normal priority.

    • SENDER

      public static final PushNotificationParameters SENDER
      Required sender device identification.

      Server side accepted values are String.

    • ORIGIN

      public static final PushNotificationParameters ORIGIN
      Required origin of the notification, generally an IP address.

      Server side accepted values are InetAddress and String.

    • KEY_ALIAS

      public static final PushNotificationParameters 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

      public final String name
      The parameter name (as in name=value).
    • isRequired

      public final boolean isRequired
      Required flag.
  • Method Details

    • values

      public static PushNotificationParameters[] 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

      public static PushNotificationParameters valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • toString

      public String toString()
      Formats the parameter as a string as PARAM["name",{required|optional}].
      Overrides:
      toString in class Enum<PushNotificationParameters>
      Returns:
      A formatted string.
    • parseURL

      public static Map<PushNotificationParameters,String> parseURL(String query)
      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.