Record Class PacketHeader.VersionNegotiation
java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.packet.PacketHeader.VersionNegotiation
- Record Components:
destinationId- the Destination Connection ID (the client's Source Connection ID)sourceId- the Source Connection ID (the client's Destination Connection ID)versions- the supported version numbers
- All Implemented Interfaces:
PacketHeader
- Enclosing interface:
PacketHeader
public static record PacketHeader.VersionNegotiation(ConnectionId destinationId, ConnectionId sourceId, List<Integer> versions)
extends Record
implements PacketHeader
A Version Negotiation packet (RFC 9000 section 17.2.1): the whole packet. The first byte is
encoded as
0xc0, with the bit that the Fixed Bit occupies in other packets set, as
RFC 9000 recommends for multiplexing.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.github.mahmoudimus.quic.packet.PacketHeader
PacketHeader.Handshake, PacketHeader.Initial, PacketHeader.Numbered, PacketHeader.Retry, PacketHeader.Short, PacketHeader.VersionNegotiation, PacketHeader.ZeroRtt -
Field Summary
Fields inherited from interface io.github.mahmoudimus.quic.packet.PacketHeader
FIXED_BIT, KEY_PHASE_BIT, LONG_HEADER_FORM, LONG_RESERVED_BITS, SHORT_RESERVED_BITS, SPIN_BIT -
Constructor Summary
ConstructorsConstructorDescriptionVersionNegotiation(ConnectionId destinationId, ConnectionId sourceId, List<Integer> versions) A Version Negotiation packet. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of thedestinationIdrecord component.encode(ByteBuffer out) Writes the header at the buffer's position.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.sourceId()Returns the value of thesourceIdrecord component.final StringtoString()Returns a string representation of this record class.type()The packet type.versions()Returns the value of theversionsrecord component.
-
Constructor Details
-
VersionNegotiation
public VersionNegotiation(ConnectionId destinationId, ConnectionId sourceId, List<Integer> versions) A Version Negotiation packet.- Parameters:
destinationId- the Destination Connection IDsourceId- the Source Connection IDversions- the supported version numbers
-
-
Method Details
-
type
Description copied from interface:PacketHeaderThe packet type.- Specified by:
typein interfacePacketHeader- Returns:
- the type
-
encode
Description copied from interface:PacketHeaderWrites the header at the buffer's position.- Specified by:
encodein interfacePacketHeader- Parameters:
out- the buffer- Returns:
- where the fields landed
-
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. All components in this record class are compared withObjects::equals(Object,Object). -
destinationId
Returns the value of thedestinationIdrecord component.- Specified by:
destinationIdin interfacePacketHeader- Returns:
- the value of the
destinationIdrecord component
-
sourceId
Returns the value of thesourceIdrecord component.- Returns:
- the value of the
sourceIdrecord component
-
versions
Returns the value of theversionsrecord component.- Returns:
- the value of the
versionsrecord component
-