Class Http3Settings

  • All Implemented Interfaces:
    java.lang.Iterable<java.util.Map.Entry<java.lang.Long,​java.lang.Long>>

    public final class Http3Settings
    extends java.lang.Object
    implements java.lang.Iterable<java.util.Map.Entry<java.lang.Long,​java.lang.Long>>
    Represents a collection of HTTP/3 settings as defined by the HTTP/3 specification.

    This class provides type-safe accessors for standard HTTP/3 settings such as:

    • QPACK_MAX_TABLE_CAPACITY (0x1)
    • MAX_FIELD_SECTION_SIZE (0x6)
    • QPACK_BLOCKED_STREAMS (0x7)
    • ENABLE_CONNECT_PROTOCOL (0x8)
    • H3_DATAGRAM (0x33)
    Non-standard settings are ignored Reserved HTTP/2 setting identifiers are rejected.
    • Method Detail

      • get

        @Nullable
        public java.lang.Long get​(long key)
        Returns the value of the specified setting identifier.
        Parameters:
        key - the numeric setting identifier
        Returns:
        the setting value, or null if not set
      • qpackMaxTableCapacity

        @Nullable
        public java.lang.Long qpackMaxTableCapacity()
        Returns the QPACK_MAX_TABLE_CAPACITY value.
        Returns:
        the current QPACK maximum table capacity, or null if not set
      • qpackMaxTableCapacity

        public Http3Settings qpackMaxTableCapacity​(long value)
        Sets the QPACK_MAX_TABLE_CAPACITY value.
        Parameters:
        value - QPACK maximum table capacity (must be ≥ 0)
        Returns:
        this instance for method chaining
      • maxFieldSectionSize

        @Nullable
        public java.lang.Long maxFieldSectionSize()
        Returns the MAX_FIELD_SECTION_SIZE value.
        Returns:
        the maximum field section size, or null if not set
      • maxFieldSectionSize

        public Http3Settings maxFieldSectionSize​(long value)
        Sets the MAX_FIELD_SECTION_SIZE value.
        Parameters:
        value - maximum field section size (must be ≥ 0)
        Returns:
        this instance for method chaining
      • qpackBlockedStreams

        @Nullable
        public java.lang.Long qpackBlockedStreams()
        Returns the QPACK_BLOCKED_STREAMS value.
        Returns:
        the number of blocked streams, or null if not set
      • qpackBlockedStreams

        public Http3Settings qpackBlockedStreams​(long value)
        Sets the QPACK_BLOCKED_STREAMS value.
        Parameters:
        value - number of blocked streams (must be ≥ 0)
        Returns:
        this instance for method chaining
      • connectProtocolEnabled

        @Nullable
        public java.lang.Boolean connectProtocolEnabled()
        Returns whether the ENABLE_CONNECT_PROTOCOL setting is enabled.
        Returns:
        true if enabled, false if disabled, or null if not set
      • enableConnectProtocol

        public Http3Settings enableConnectProtocol​(boolean enabled)
        Sets the ENABLE_CONNECT_PROTOCOL flag.
        Parameters:
        enabled - whether to enable the CONNECT protocol
        Returns:
        this instance for method chaining
      • h3DatagramEnabled

        @Nullable
        public java.lang.Boolean h3DatagramEnabled()
        Returns whether the H3_DATAGRAM setting is enabled.
        Returns:
        true if enabled, false if disabled, or null if not set
      • enableH3Datagram

        public Http3Settings enableH3Datagram​(boolean enabled)
        Sets the H3_DATAGRAM settings identifier.
        Parameters:
        enabled - whether to enable the H3 Datagram
        Returns:
        this instance for method chaining
      • putAll

        public Http3Settings putAll​(Http3Settings http3Settings)
        Replaces all current settings with those from another Http3Settings instance.
        Parameters:
        http3Settings - the source settings (non-null)
        Returns:
        this instance for method chaining
      • defaultSettings

        public static Http3Settings defaultSettings()
        Returns a new Http3Settings instance with default values:
        • QPACK_MAX_TABLE_CAPACITY = 0
        • QPACK_BLOCKED_STREAMS = 0
        • ENABLE_CONNECT_PROTOCOL = false
        • MAX_FIELD_SECTION_SIZE = unlimited
        • H3_DATAGRAM = false
        Returns:
        a default Http3Settings instance
      • iterator

        public java.util.Iterator<java.util.Map.Entry<java.lang.Long,​java.lang.Long>> iterator()
        Returns an iterator over the settings entries in this object. Each entry’s key is the numeric setting identifier, and the value is its numeric value.
        Specified by:
        iterator in interface java.lang.Iterable<java.util.Map.Entry<java.lang.Long,​java.lang.Long>>
        Returns:
        an iterator over immutable Map.Entry objects
      • equals

        public boolean equals​(java.lang.Object o)
        Compares this settings object to another for equality. Two instances are equal if they contain the same key–value pairs.
        Overrides:
        equals in class java.lang.Object
        Parameters:
        o - the other object
        Returns:
        true if equal, false otherwise
      • hashCode

        public int hashCode()
        Returns the hash code of this settings object, based on its key–value pairs.
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        the hash code
      • toString

        public java.lang.String toString()
        Returns a string representation of this settings object in the form:
         Http3Settings{0x1=100, 0x6=16384, 0x7=0}
         
        Overrides:
        toString in class java.lang.Object
        Returns:
        a human-readable string representation of the settings