Class Http2Settings

  • All Implemented Interfaces:
    CharObjectMap<Long>, Map<Character,​Long>

    @UnstableApi
    public final class Http2Settings
    extends CharObjectHashMap<Long>
    Settings for one endpoint in an HTTP/2 connection. Each of the values are optional as defined in the spec for the SETTINGS frame. Permits storage of arbitrary key/value pairs but provides helper methods for standard settings.
    • Constructor Detail

      • Http2Settings

        public Http2Settings()
      • Http2Settings

        public Http2Settings​(int initialCapacity,
                             float loadFactor)
      • Http2Settings

        public Http2Settings​(int initialCapacity)
    • Method Detail

      • put

        public Long put​(char key,
                        Long value)
        Adds the given setting key/value pair. For standard settings defined by the HTTP/2 spec, performs validation on the values.
        Specified by:
        put in interface CharObjectMap<Long>
        Overrides:
        put in class CharObjectHashMap<Long>
        Parameters:
        key - the key of the entry.
        value - the value of the entry.
        Returns:
        the previous value for this key or null if there was no previous mapping.
        Throws:
        IllegalArgumentException - if verification for a standard HTTP/2 setting fails.
      • headerTableSize

        public Long headerTableSize()
        Gets the SETTINGS_HEADER_TABLE_SIZE value. If unavailable, returns null.
      • headerTableSize

        public Http2Settings headerTableSize​(long value)
        Sets the SETTINGS_HEADER_TABLE_SIZE value.
        Throws:
        IllegalArgumentException - if verification of the setting fails.
      • pushEnabled

        public Boolean pushEnabled()
        Gets the SETTINGS_ENABLE_PUSH value. If unavailable, returns null.
      • pushEnabled

        public Http2Settings pushEnabled​(boolean enabled)
        Sets the SETTINGS_ENABLE_PUSH value.
      • maxConcurrentStreams

        public Long maxConcurrentStreams()
        Gets the SETTINGS_MAX_CONCURRENT_STREAMS value. If unavailable, returns null.
      • maxConcurrentStreams

        public Http2Settings maxConcurrentStreams​(long value)
        Sets the SETTINGS_MAX_CONCURRENT_STREAMS value.
        Throws:
        IllegalArgumentException - if verification of the setting fails.
      • initialWindowSize

        public Integer initialWindowSize()
        Gets the SETTINGS_INITIAL_WINDOW_SIZE value. If unavailable, returns null.
      • initialWindowSize

        public Http2Settings initialWindowSize​(int value)
        Sets the SETTINGS_INITIAL_WINDOW_SIZE value.
        Throws:
        IllegalArgumentException - if verification of the setting fails.
      • maxFrameSize

        public Integer maxFrameSize()
        Gets the SETTINGS_MAX_FRAME_SIZE value. If unavailable, returns null.
      • maxHeaderListSize

        public Long maxHeaderListSize()
        Gets the SETTINGS_MAX_HEADER_LIST_SIZE value. If unavailable, returns null.
      • maxHeaderListSize

        public Http2Settings maxHeaderListSize​(long value)
        Sets the SETTINGS_MAX_HEADER_LIST_SIZE value.
        Throws:
        IllegalArgumentException - if verification of the setting fails.
      • copyFrom

        public Http2Settings copyFrom​(Http2Settings settings)
        Clears and then copies the given settings into this object.
      • defaultSettings

        public static Http2Settings defaultSettings()