Record Class PushSubscribeResultImpl

java.lang.Object
java.lang.Record
com.iizix.server.push.api.PushSubscribeResultImpl
Record Components:
created - true for a new row, false when the device's existing row for the same application and Topic was updated with a new subscription or token, or was already identical.
subscription - The row as stored, never null.
All Implemented Interfaces:
IPushSubscribeResult

public record PushSubscribeResultImpl(boolean created, IPushSubscriptionInfo subscription) extends Record implements IPushSubscribeResult
The IPushSubscribeResult a subscribe answers with (P4-07): whether the row is new, and the row as stored, without its key material (PUSH-WIRE-CONTRACT section 5.2's created, and the subscription entry of section 5.5).
Author:
Christopher Mindus
  • Constructor Details

    • PushSubscribeResultImpl

      public PushSubscribeResultImpl(boolean created, IPushSubscriptionInfo subscription)
      Creates an instance of a PushSubscribeResultImpl record class.
      Parameters:
      created - the value for the created record component
      subscription - the value for the subscription record component
  • Method Details

    • isCreated

      public boolean isCreated()
      Description copied from interface: IPushSubscribeResult
      Checks whether a new subscription was stored.
      Specified by:
      isCreated in interface IPushSubscribeResult
      Returns:
      true for a new subscription, false when the device's existing subscription for the same application and topic was updated with a new endpoint or token, or was already identical.
    • getSubscription

      public IPushSubscriptionInfo getSubscription()
      Description copied from interface: IPushSubscribeResult
      Gets the subscription as stored.
      Specified by:
      getSubscription in interface IPushSubscribeResult
      Returns:
      The subscription, never null.
    • 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. Reference components are compared with Objects::equals(Object,Object); primitive components are compared with the compare method from their corresponding wrapper classes.
      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.
    • created

      public boolean created()
      Returns the value of the created record component.
      Returns:
      the value of the created record component
    • subscription

      public IPushSubscriptionInfo subscription()
      Returns the value of the subscription record component.
      Returns:
      the value of the subscription record component