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 Summary
ConstructorsConstructorDescriptionPushSendResultImpl(String messageID, List<IPushTargetOutcome> targetOutcomes) Creates an instance of aPushSendResultImplrecord class.Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.intGets the number of targets delivered, in-session or by a transport: theDeliveryOutcome.DELIVERED_IN_SESSIONandDeliveryOutcome.DELIVEREDcounts together.Gets the message ID the server assigned to the notification, carried to the device asdata.iizi.messageand quoted by every receipt and action event of it.Gets the number of targets per outcome, counted fromIPushSendResult.getTargetOutcomes().Gets the outcome of every target the send matched, in no particular order.final inthashCode()Returns a hash code value for this object.Returns the value of themessageIDrecord component.Returns the value of thetargetOutcomesrecord component.final StringtoString()Returns a string representation of this record class.
Constructor Details
PushSendResultImpl
Creates an instance of aPushSendResultImplrecord class.- Parameters:
messageID- the value for themessageIDrecord componenttargetOutcomes- the value for thetargetOutcomesrecord component
Method Details
getMessageID
Description copied from interface:IPushSendResultGets the message ID the server assigned to the notification, carried to the device asdata.iizi.messageand quoted by every receipt and action event of it.- Specified by:
getMessageIDin interfaceIPushSendResult- Returns:
- The message ID, a UUID, never
null.
getTargetOutcomes
Description copied from interface:IPushSendResultGets the outcome of every target the send matched, in no particular order.- Specified by:
getTargetOutcomesin interfaceIPushSendResult- Returns:
- An unmodifiable list, never
null; empty when nothing matched.
getOutcomeCounts
Description copied from interface:IPushSendResultGets the number of targets per outcome, counted fromIPushSendResult.getTargetOutcomes().- Specified by:
getOutcomeCountsin interfaceIPushSendResult- Returns:
- An unmodifiable map holding only the outcomes that occurred, never
null.
getDeliveredCount
public int getDeliveredCount()Description copied from interface:IPushSendResultGets the number of targets delivered, in-session or by a transport: theDeliveryOutcome.DELIVERED_IN_SESSIONandDeliveryOutcome.DELIVEREDcounts together.- Specified by:
getDeliveredCountin interfaceIPushSendResult- Returns:
- The delivered count.
toString
hashCode
equals
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 withObjects::equals(Object,Object).messageID
targetOutcomes
Returns the value of thetargetOutcomesrecord component.- Returns:
- the value of the
targetOutcomesrecord component