Package org.omegazero.http.h2.util
Class HTTP2Settings
java.lang.Object
org.omegazero.http.h2.util.HTTP2Settings
An instance of this class stores HTTP/2 settings for a connection.
- Since:
- 1.2.1
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a newHTTP2Settingswith default settings.HTTP2Settings(int[] data) Creates a newHTTP2Settingswith the given settings.HTTP2Settings(HTTP2Settings settings) Creates a newHTTP2Settingswith the given settings. -
Method Summary
Modifier and TypeMethodDescriptionintget(int setting) Returns the setting identified by the given setting number defined inHTTPConstants.static intgetDefault(int setting) Returns the default value for the given setting number defined inHTTPConstants.static int[]Returns an array containing the defaultHTTP2Settings.voidset(int setting, int value) Sets the setting identified by the given setting number defined inHTTPConstantsto the given value.
-
Constructor Details
-
HTTP2Settings
public HTTP2Settings()Creates a newHTTP2Settingswith default settings. -
HTTP2Settings
public HTTP2Settings(int[] data) Creates a newHTTP2Settingswith the given settings. The index of each element is the HTTP/2 setting ID.- Parameters:
data- The settings- Throws:
IllegalArgumentException- If the array does not have exactlyHTTP2Constants.SETTINGS_COUNTelements
-
HTTP2Settings
Creates a newHTTP2Settingswith the given settings.- Parameters:
settings- The settings
-
-
Method Details
-
get
public int get(int setting) Returns the setting identified by the given setting number defined inHTTPConstants.- Parameters:
setting- The setting number- Returns:
- The value
- Throws:
IllegalArgumentException- If the given setting number is invalid
-
set
public void set(int setting, int value) Sets the setting identified by the given setting number defined inHTTPConstantsto the given value.- Parameters:
setting- The setting numbervalue- The value- Throws:
IllegalArgumentException- If the given setting number is invalid
-
getDefault
public static int getDefault(int setting) Returns the default value for the given setting number defined inHTTPConstants.- Parameters:
setting- The setting number- Returns:
- The default value
- Throws:
IllegalArgumentException- If the given setting number is invalid
-
getDefaultSettingsData
public static int[] getDefaultSettingsData()Returns an array containing the defaultHTTP2Settings.- Returns:
- The settings
-