Record Class UnknownParameter

java.lang.Object
java.lang.Record
io.github.mahmoudimus.quic.params.UnknownParameter
Record Components:
id - the parameter ID
value - the raw value

public record UnknownParameter(long id, byte[] value) extends Record
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

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The bound on the length of the values grease(java.util.Random) generates, as in quinn.
  • Constructor Summary

    Constructors
    Constructor
    Description
    UnknownParameter(long id, byte[] value)
    An unknown parameter.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Indicates whether some other object is "equal to" this one.
    grease(Random random)
    A reserved parameter with a random ID of the form 31 * N + 27 and up to 15 random bytes, to exercise the peer's handling of unknown parameters (RFC 9000 section 18.1).
    int
    Returns a hash code value for this object.
    long
    id()
    Returns the value of the id record component.
    static boolean
    isReserved(long id)
    Whether an ID is reserved for GREASE, that is, of the form 31 * N + 27.
    Returns a string representation of this record class.
    byte[]
    The raw value.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • UnknownParameter

      public UnknownParameter(long id, byte[] value)
      An unknown parameter.
      Parameters:
      id - the parameter ID
      value - the raw value, copied
  • Method Details

    • grease

      public static UnknownParameter grease(Random random)
      A reserved parameter with a random ID of the form 31 * N + 27 and 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 form 31 * 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

      public boolean equals(Object o)
      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 with Objects::equals(Object,Object); primitive components are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • toString

      public String 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.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • id

      public long id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component