Record Class StreamId
java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.connection.StreamId
- Record Components:
value- the 62-bit stream ID as sent on the wire
- All Implemented Interfaces:
Comparable<StreamId>
A stream ID (RFC 9000 section 2.1): the two low bits give the initiator and direction, the rest
the stream's index among the streams of that type.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintdir()The stream's directionality.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longindex()The stream's index among streams of its type.The side that opened the stream.static StreamIdThe stream ID of a stream type and index.toString()As inclient bidirectional stream 0.longvalue()Returns the value of thevaluerecord component.
-
Constructor Details
-
StreamId
public StreamId(long value) A stream ID.- Parameters:
value- 0 to 262-1
-
-
Method Details
-
of
The stream ID of a stream type and index.- Parameters:
initiator- the side that opens the streamdir- the stream's directionalityindex- the stream's index among streams of its type, below 260- Returns:
- the stream ID
-
initiator
The side that opened the stream.- Returns:
- the initiator
-
dir
The stream's directionality. -
index
public long index()The stream's index among streams of its type.- Returns:
- the index
-
compareTo
- Specified by:
compareToin interfaceComparable<StreamId>
-
toString
As inclient bidirectional stream 0. -
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 with '=='. -
value
public long value()Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-