Module bus.http

Class Http2Settings

java.lang.Object
org.miaixz.bus.http.metric.http.Http2Settings

public final class Http2Settings extends Object
Settings describe characteristics of the sending peer, which are used by the receiving peer. Settings are scoped to an connection.
Since:
Java 17+
Author:
Kimi Liu
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
    The total number of settings.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Clears all settings.
    int
    get(int id)
    Returns the value for the setting id, or 0 if not set.
    boolean
    getEnablePush(boolean defaultValue)
    Returns whether server push is enabled.
    int
    Returns the header table size, or -1 if not set.
    int
    Returns the initial window size.
    int
    getMaxConcurrentStreams(int defaultValue)
    Returns the maximum number of concurrent streams, or the default value if not set.
    int
    getMaxFrameSize(int defaultValue)
    Returns the maximum frame size, or the default value if not set.
    int
    getMaxHeaderListSize(int defaultValue)
    Returns the maximum header list size, or the default value if not set.
    boolean
    isSet(int id)
    Returns true if a value has been assigned for the setting id.
    void
    Merges the settings from other into this.
    set(int id, int value)
    Sets a setting with the given ID and value.
    int
    Returns the number of settings that have been set.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • Http2Settings

      public Http2Settings()
  • Method Details

    • clear

      public void clear()
      Clears all settings.
    • set

      public Http2Settings set(int id, int value)
      Sets a setting with the given ID and value.
      Parameters:
      id - The ID of the setting.
      value - The value of the setting.
      Returns:
      This Http2Settings instance.
    • isSet

      public boolean isSet(int id)
      Returns true if a value has been assigned for the setting id.
      Parameters:
      id - The setting ID.
      Returns:
      true if the setting is set.
    • get

      public int get(int id)
      Returns the value for the setting id, or 0 if not set.
      Parameters:
      id - The setting ID.
      Returns:
      The value of the setting.
    • size

      public int size()
      Returns the number of settings that have been set.
      Returns:
      The number of set settings.
    • getHeaderTableSize

      public int getHeaderTableSize()
      Returns the header table size, or -1 if not set.
      Returns:
      The header table size.
    • getEnablePush

      public boolean getEnablePush(boolean defaultValue)
      Returns whether server push is enabled.
      Parameters:
      defaultValue - The default value to return if not set.
      Returns:
      true if server push is enabled.
    • getMaxConcurrentStreams

      public int getMaxConcurrentStreams(int defaultValue)
      Returns the maximum number of concurrent streams, or the default value if not set.
      Parameters:
      defaultValue - The default value.
      Returns:
      The maximum number of concurrent streams.
    • getMaxFrameSize

      public int getMaxFrameSize(int defaultValue)
      Returns the maximum frame size, or the default value if not set.
      Parameters:
      defaultValue - The default value.
      Returns:
      The maximum frame size.
    • getMaxHeaderListSize

      public int getMaxHeaderListSize(int defaultValue)
      Returns the maximum header list size, or the default value if not set.
      Parameters:
      defaultValue - The default value.
      Returns:
      The maximum header list size.
    • getInitialWindowSize

      public int getInitialWindowSize()
      Returns the initial window size.
      Returns:
      The initial window size.
    • merge

      public void merge(Http2Settings other)
      Merges the settings from other into this. If any setting is populated by both this and other, the value and flags from other will be kept.
      Parameters:
      other - The other settings to merge.