Record Class FcmTransport.Target
java.lang.Object
java.lang.Record
com.iizix.server.push.engine.transport.FcmTransport.Target
- Record Components:
field- The message member,TOKENorTOPIC.value- The registration token or the Topic name, never null; the empty string is a stand-inFcmTransport.payloadSize(PushMessage)uses.
- Enclosing class:
FcmTransport
The target of a message: a registration token (
message.token) or an FCM Topic (message.topic, the name without the /topics/ prefix). Exactly one of the two members is written. FCM's Topic charset, [a-zA-Z0-9-_.~%]+, is not checked here: no server path sends to a Topic, and a fan-out that would is not designed (see the class comment).- Author:
- Christopher Mindus
Field Summary
FieldsConstructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.field()Returns the value of thefieldrecord component.final inthashCode()Returns a hash code value for this object.static FcmTransport.TargetA registration token target, whatFcmTransport.send(SubscriptionRecord, PushMessage, long, DeliveryUrgency)addresses.static FcmTransport.TargetA Topic target.final StringtoString()Returns a string representation of this record class.value()Returns the value of thevaluerecord component.
Field Details
TOKEN
TOPIC
Constructor Details
Target
Validates the components.- Throws:
NullPointerException- If either is null.IllegalArgumentException- If the member is neitherTOKENnorTOPIC.
Method Details
token
A registration token target, whatFcmTransport.send(SubscriptionRecord, PushMessage, long, DeliveryUrgency)addresses.- Parameters:
registrationToken- The device token.- Returns:
- The target.
topic
A Topic target.- Parameters:
topic- The Topic name, without/topics/.- Returns:
- The target.
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).field
value