Record Class Frame.Settings

java.lang.Object
java.lang.Record
io.github.mahmoudimus.http2.Frame.Settings
Record Components:
ack - whether this acknowledges the peer settings
values - setting identifiers and unsigned 32-bit values; empty for an ACK
All Implemented Interfaces:
Frame
Enclosing interface:
Frame

public static record Frame.Settings(boolean ack, Map<Integer,Long> values) extends Record implements Frame
SETTINGS (§6.5). values maps setting identifiers to their (unsigned 32-bit) values in the order they first appeared; a repeated identifier keeps its last value, which is what processing them in order would give. Unknown identifiers are kept so callers can see them, and must be ignored. An ACK has no values.
  • Constructor Details

    • Settings

      public Settings(boolean ack, Map<Integer,Long> values)
      Creates SETTINGS with an immutable copy of its values.
      Parameters:
      ack - whether this acknowledges the peer settings
      values - setting identifiers and unsigned 32-bit values; empty for an ACK
  • Method Details

    • acknowledgement

      public static Frame.Settings acknowledgement()
      The acknowledgement of a peer's SETTINGS.
      Returns:
      an empty SETTINGS frame with ACK set
    • streamId

      public int streamId()
      Description copied from interface: Frame
      The stream this frame belongs to, or 0 for the connection.
      Specified by:
      streamId in interface Frame
      Returns:
      the stream identifier, or 0 for the connection
    • type

      public int type()
      Description copied from interface: Frame
      The frame type code, one of the FrameType constants (or any value for Frame.Unknown).
      Specified by:
      type in interface Frame
      Returns:
      the unsigned frame type code
    • toString

      public final 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
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final 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.
    • ack

      public boolean ack()
      Returns the value of the ack record component.
      Returns:
      the value of the ack record component
    • values

      public Map<Integer,Long> values()
      Returns the value of the values record component.
      Returns:
      the value of the values record component