Record Class Http2Frame.Settings

java.lang.Object
java.lang.Record
org.microproxy.frames.Http2Frame.Settings
Record Components:
ack - whether this acknowledges the peer's SETTINGS
values - setting identifiers and their unsigned 32-bit values
All Implemented Interfaces:
Http2Frame, HttpFrame
Enclosing interface:
Http2Frame

public static record Http2Frame.Settings(boolean ack, Map<Integer,Long> values) extends Record implements Http2Frame
SETTINGS (section 6.5): the identifiers and values the frame carries, in order. An acknowledgement carries none.
  • Constructor Details

    • Settings

      public Settings(boolean ack, Map<Integer,Long> values)
      Creates SETTINGS.
      Parameters:
      ack - whether this acknowledges the peer's SETTINGS
      values - setting identifiers (0 to 65535) and values (0 to 2^32-1), copied; empty for an ACK
  • Method Details

    • streamId

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

      public String typeName()
      Description copied from interface: HttpFrame
      The frame type's name as the protocol's RFC spells it (DATA, HEADERS, SETTINGS, ...), or UNKNOWN for an extension or reserved type.
      Specified by:
      typeName in interface HttpFrame
      Returns:
      the frame type name
    • typeCode

      public long typeCode()
      Description copied from interface: HttpFrame
      The frame type's code on the wire.
      Specified by:
      typeCode in interface HttpFrame
      Returns:
      the unsigned type code
    • get

      public Long get(int id)
      A setting's value in this frame.
      Parameters:
      id - the setting identifier
      Returns:
      the value, or null if the frame does not carry it
    • withValue

      public Http2Frame.Settings withValue(int id, long value)
      This frame with one setting set.
      Parameters:
      id - the setting identifier
      value - the value
      Returns:
      a copy with the setting
    • withoutValue

      public Http2Frame.Settings withoutValue(int id)
      This frame without one setting.
      Parameters:
      id - the setting identifier
      Returns:
      a copy without it
    • withValues

      public Http2Frame.Settings withValues(Map<Integer,Long> newValues)
      This frame with other settings.
      Parameters:
      newValues - the settings
      Returns:
      a copy with them
    • 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