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 Summary
ConstructorsConstructorDescriptionPushSubscribeResultImpl(boolean created, IPushSubscriptionInfo subscription) Creates an instance of aPushSubscribeResultImplrecord class.Method Summary
Modifier and TypeMethodDescriptionbooleancreated()Returns the value of thecreatedrecord component.final booleanIndicates whether some other object is "equal to" this one.Gets the subscription as stored.final inthashCode()Returns a hash code value for this object.booleanChecks whether a new subscription was stored.Returns the value of thesubscriptionrecord component.final StringtoString()Returns a string representation of this record class.
Constructor Details
PushSubscribeResultImpl
Creates an instance of aPushSubscribeResultImplrecord class.- Parameters:
created- the value for thecreatedrecord componentsubscription- the value for thesubscriptionrecord component
Method Details
isCreated
public boolean isCreated()Description copied from interface:IPushSubscribeResultChecks whether a new subscription was stored.- Specified by:
isCreatedin interfaceIPushSubscribeResult- Returns:
truefor a new subscription,falsewhen the device's existing subscription for the same application and topic was updated with a new endpoint or token, or was already identical.
getSubscription
Description copied from interface:IPushSubscribeResultGets the subscription as stored.- Specified by:
getSubscriptionin interfaceIPushSubscribeResult- Returns:
- The subscription, never
null.
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes.created
subscription
Returns the value of thesubscriptionrecord component.- Returns:
- the value of the
subscriptionrecord component