Record Class PushSendResultImpl

java.lang.Object
java.lang.Record
com.iizix.server.push.api.PushSendResultImpl
Record Components:
messageID - The message ID, a UUID.
targetOutcomes - The outcomes, unmodifiable.
All Implemented Interfaces:
IPushSendResult

public record PushSendResultImpl(String messageID, List<IPushTargetOutcome> targetOutcomes) extends Record implements IPushSendResult
The result of a send made through the Java API: the message ID and one outcome per target (PUSH-WIRE-CONTRACT section 9.3). The tally is derived from the list, so the two cannot disagree.
Author:
Christopher Mindus
  • Constructor Details

    • PushSendResultImpl

      public PushSendResultImpl(String messageID, List<IPushTargetOutcome> targetOutcomes)
      Creates an instance of a PushSendResultImpl record class.
      Parameters:
      messageID - the value for the messageID record component
      targetOutcomes - the value for the targetOutcomes record component
  • Method Details

    • getMessageID

      public String getMessageID()
      Description copied from interface: IPushSendResult
      Gets the message ID the server assigned to the notification, carried to the device as data.iizi.message and quoted by every receipt and action event of it.
      Specified by:
      getMessageID in interface IPushSendResult
      Returns:
      The message ID, a UUID, never null.
    • getTargetOutcomes

      public List<IPushTargetOutcome> getTargetOutcomes()
      Description copied from interface: IPushSendResult
      Gets the outcome of every target the send matched, in no particular order.
      Specified by:
      getTargetOutcomes in interface IPushSendResult
      Returns:
      An unmodifiable list, never null; empty when nothing matched.
    • getOutcomeCounts

      public Map<DeliveryOutcome, Integer> getOutcomeCounts()
      Description copied from interface: IPushSendResult
      Gets the number of targets per outcome, counted from IPushSendResult.getTargetOutcomes().
      Specified by:
      getOutcomeCounts in interface IPushSendResult
      Returns:
      An unmodifiable map holding only the outcomes that occurred, never null.
    • getDeliveredCount

      public int getDeliveredCount()
      Description copied from interface: IPushSendResult
      Gets the number of targets delivered, in-session or by a transport: the DeliveryOutcome.DELIVERED_IN_SESSION and DeliveryOutcome.DELIVERED counts together.
      Specified by:
      getDeliveredCount in interface IPushSendResult
      Returns:
      The delivered count.
    • 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.
    • messageID

      public String messageID()
      Returns the value of the messageID record component.
      Returns:
      the value of the messageID record component
    • targetOutcomes

      public List<IPushTargetOutcome> targetOutcomes()
      Returns the value of the targetOutcomes record component.
      Returns:
      the value of the targetOutcomes record component