public class WebSocketExtension extends Object
WebSocket Extension HTTP headers may include parameters and follow RFC 7230 section 3.2
Note that the order of extensions in HTTP headers defines their order of execution, e.g. extensions "foo, bar" will be executed as "bar(foo(message))".
Constructor and Description |
---|
WebSocketExtension(String name)
Create a WebSocketExtension with the given name.
|
WebSocketExtension(String name,
Map<String,String> parameters)
Create a WebSocketExtension with the given name and parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object other) |
String |
getName()
Return the name of the extension (never
null or empty). |
Map<String,String> |
getParameters()
Return the parameters of the extension (never
null ). |
int |
hashCode() |
static List<WebSocketExtension> |
parseExtensions(String extensions)
Parse the given, comma-separated string into a list of
WebSocketExtension objects. |
String |
toString() |
public WebSocketExtension(String name)
name
- the name of the extensionpublic String getName()
null
or empty).public Map<String,String> getParameters()
null
).public static List<WebSocketExtension> parseExtensions(String extensions)
WebSocketExtension
objects.
This method can be used to parse a "Sec-WebSocket-Extension" header.
extensions
- the string to parseIllegalArgumentException
- if the string cannot be parsed