Package io.github.mahmoudimus.quic.token
Record Class IncomingToken
java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.token.IncomingToken
- Record Components:
retrySourceId- the Source Connection ID of the server's Retry, which the server echoes inretry_source_connection_id, or null without a Retry tokenoriginalDestinationId- the Destination Connection ID of the client's first Initial, fororiginal_destination_connection_idvalidated- whether the client's address is validated, lifting the anti-amplification limit
public record IncomingToken(ConnectionId retrySourceId, ConnectionId originalDestinationId, boolean validated)
extends Record
What the token in a client's first Initial packet establishes.
-
Constructor Summary
ConstructorsConstructorDescriptionIncomingToken(ConnectionId retrySourceId, ConnectionId originalDestinationId, boolean validated) The result of validating a token. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theoriginalDestinationIdrecord component.Returns the value of theretrySourceIdrecord component.final StringtoString()Returns a string representation of this record class.static IncomingTokenunvalidated(ConnectionId destinationId) No usable token: the address is not validated.booleanReturns the value of thevalidatedrecord component.
-
Constructor Details
-
IncomingToken
public IncomingToken(ConnectionId retrySourceId, ConnectionId originalDestinationId, boolean validated) The result of validating a token.- Parameters:
retrySourceId- the Retry's Source Connection ID, or nulloriginalDestinationId- the original Destination Connection IDvalidated- whether the address is validated
-
-
Method Details
-
unvalidated
No usable token: the address is not validated.- Parameters:
destinationId- the Destination Connection ID of the Initial packet- Returns:
- the result
-
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. -
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. -
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 '=='. -
retrySourceId
Returns the value of theretrySourceIdrecord component.- Returns:
- the value of the
retrySourceIdrecord component
-
originalDestinationId
Returns the value of theoriginalDestinationIdrecord component.- Returns:
- the value of the
originalDestinationIdrecord component
-
validated
public boolean validated()Returns the value of thevalidatedrecord component.- Returns:
- the value of the
validatedrecord component
-