Record Class PushSendOptions

java.lang.Object
java.lang.Record
com.iizix.push.PushSendOptions
Record Components:
timeToLive - How long the push services should keep trying, or null for the default.
urgency - The delivery urgency, or null for DeliveryUrgency.DEFAULT.
deliveryMode - In-session, device or both, or null for IPushSettings.getDefaultDeliveryMode().

public record PushSendOptions(Duration timeToLive, DeliveryUrgency urgency, DeliveryMode deliveryMode) extends Record
The per-send options of the Push Notification API. Every component may be null, meaning the default; null for the whole options argument means every default.

The time-to-live is a Duration, so no caller has to know that the wire and the transports count seconds (ruling R10, RFC 8030) while the engine counts milliseconds (IPushNotification.getTimeToLiveMillis()). A timeToLive here overrides the notification's own. Its range is one minute to 28 days, the bounds of IPushSettings; a value outside it is refused with IllegalArgumentException by the method it is passed to, never clamped silently. null means the application's TTL property in its .iiziPush, and 28 days when the application has none.

Author:
Christopher Mindus
  • Constructor Details

    • PushSendOptions

      public PushSendOptions(Duration timeToLive, DeliveryUrgency urgency, DeliveryMode deliveryMode)
      Creates an instance of a PushSendOptions record class.
      Parameters:
      timeToLive - the value for the timeToLive record component
      urgency - the value for the urgency record component
      deliveryMode - the value for the deliveryMode record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • timeToLive

      public Duration timeToLive()
      Returns the value of the timeToLive record component.
      Returns:
      the value of the timeToLive record component
    • urgency

      public DeliveryUrgency urgency()
      Returns the value of the urgency record component.
      Returns:
      the value of the urgency record component
    • deliveryMode

      public DeliveryMode deliveryMode()
      Returns the value of the deliveryMode record component.
      Returns:
      the value of the deliveryMode record component