java.lang.Object
org.miaixz.bus.http.metric.http.Http2Settings
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clears all settings.intget(int id) Returns the value for the settingid, or 0 if not set.booleangetEnablePush(boolean defaultValue) Returns whether server push is enabled.intReturns the header table size, or -1 if not set.intReturns the initial window size.intgetMaxConcurrentStreams(int defaultValue) Returns the maximum number of concurrent streams, or the default value if not set.intgetMaxFrameSize(int defaultValue) Returns the maximum frame size, or the default value if not set.intgetMaxHeaderListSize(int defaultValue) Returns the maximum header list size, or the default value if not set.booleanisSet(int id) Returns true if a value has been assigned for the settingid.voidmerge(Http2Settings other) Merges the settings fromotherinto this.set(int id, int value) Sets a setting with the given ID and value.intsize()Returns the number of settings that have been set.
-
Field Details
-
COUNT
public static final int COUNTThe total number of settings.- See Also:
-
-
Constructor Details
-
Http2Settings
public Http2Settings()
-
-
Method Details
-
clear
public void clear()Clears all settings. -
set
Sets a setting with the given ID and value.- Parameters:
id- The ID of the setting.value- The value of the setting.- Returns:
- This
Http2Settingsinstance.
-
isSet
public boolean isSet(int id) Returns true if a value has been assigned for the settingid.- Parameters:
id- The setting ID.- Returns:
trueif the setting is set.
-
get
public int get(int id) Returns the value for the settingid, 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:
trueif 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
Merges the settings fromotherinto this. If any setting is populated by both this andother, the value and flags fromotherwill be kept.- Parameters:
other- The other settings to merge.
-