Class Http2Settings

  • All Implemented Interfaces:
    CharObjectMap<java.lang.Long>, java.util.Map<java.lang.Character,​java.lang.Long>

    public final class Http2Settings
    extends CharObjectHashMap<java.lang.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 java.lang.Long put​(char key,
                                  java.lang.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<java.lang.Long>
        Overrides:
        put in class CharObjectHashMap<java.lang.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:
        java.lang.IllegalArgumentException - if verification for a standard HTTP/2 setting fails.
      • headerTableSize

        public java.lang.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:
        java.lang.IllegalArgumentException - if verification of the setting fails.
      • pushEnabled

        public java.lang.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 java.lang.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:
        java.lang.IllegalArgumentException - if verification of the setting fails.
      • initialWindowSize

        public java.lang.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:
        java.lang.IllegalArgumentException - if verification of the setting fails.
      • maxFrameSize

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

        public Http2Settings maxFrameSize​(int value)
        Sets the SETTINGS_MAX_FRAME_SIZE value.
        Throws:
        java.lang.IllegalArgumentException - if verification of the setting fails.
      • maxHeaderListSize

        public java.lang.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:
        java.lang.IllegalArgumentException - if verification of the setting fails.
      • copyFrom

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

        public java.lang.Integer getIntValue​(char key)
        A helper method that returns Long.intValue() on the return of CharObjectHashMap.get(char), if present. Note that if the range of the value exceeds Integer.MAX_VALUE, the CharObjectHashMap.get(char) method should be used instead to avoid truncation of the value.
      • keyToString

        protected java.lang.String keyToString​(char key)
        Description copied from class: CharObjectHashMap
        Helper method called by CharObjectHashMap.toString() in order to convert a single map key into a string. This is protected to allow subclasses to override the appearance of a given key.
        Overrides:
        keyToString in class CharObjectHashMap<java.lang.Long>
      • defaultSettings

        public static Http2Settings defaultSettings()