Record Class UnknownParameter
java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.params.UnknownParameter
- Record Components:
id- the parameter IDvalue- the raw value
A transport parameter this module does not interpret, kept as received: a reserved (GREASE)
parameter or an extension. Decoding preserves unknown parameters so that they can be inspected
or re-sent; peers must ignore them (RFC 9000 section 18.1).
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe bound on the length of the valuesgrease(java.util.Random)generates, as in quinn. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether some other object is "equal to" this one.static UnknownParameterA reserved parameter with a random ID of the form31 * N + 27and up to 15 random bytes, to exercise the peer's handling of unknown parameters (RFC 9000 section 18.1).inthashCode()Returns a hash code value for this object.longid()Returns the value of theidrecord component.static booleanisReserved(long id) Whether an ID is reserved for GREASE, that is, of the form31 * N + 27.toString()Returns a string representation of this record class.byte[]value()The raw value.
-
Field Details
-
MAX_GREASE_LENGTH
public static final int MAX_GREASE_LENGTHThe bound on the length of the valuesgrease(java.util.Random)generates, as in quinn.- See Also:
-
-
Constructor Details
-
UnknownParameter
public UnknownParameter(long id, byte[] value) An unknown parameter.- Parameters:
id- the parameter IDvalue- the raw value, copied
-
-
Method Details
-
grease
A reserved parameter with a random ID of the form31 * N + 27and up to 15 random bytes, to exercise the peer's handling of unknown parameters (RFC 9000 section 18.1).- Parameters:
random- the source of randomness- Returns:
- the parameter
-
isReserved
public static boolean isReserved(long id) Whether an ID is reserved for GREASE, that is, of the form31 * N + 27.- Parameters:
id- the parameter ID- Returns:
- true for a reserved ID
-
value
public byte[] value()The raw value.- Returns:
- a copy of the value
-
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 '=='. -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
id
public long id()Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-