public class WebSocketExtension
extends java.lang.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(java.lang.String name)
Create a WebSocketExtension with the given name.
|
WebSocketExtension(java.lang.String name,
java.util.Map<java.lang.String,java.lang.String> parameters)
Create a WebSocketExtension with the given name and parameters.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
java.lang.String |
getName()
Return the name of the extension (never
null) or empty . |
java.util.Map<java.lang.String,java.lang.String> |
getParameters()
Return the parameters of the extension (never
null ). |
int |
hashCode() |
static java.util.List<WebSocketExtension> |
parseExtensions(java.lang.String extensions)
Parse the given, comma-separated string into a list of
WebSocketExtension objects. |
java.lang.String |
toString() |
public WebSocketExtension(java.lang.String name)
name
- the name of the extensionpublic WebSocketExtension(java.lang.String name, java.util.Map<java.lang.String,java.lang.String> parameters)
name
- the name of the extensionparameters
- the parameterspublic java.lang.String getName()
null) or empty
.public java.util.Map<java.lang.String,java.lang.String> getParameters()
null
).public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static java.util.List<WebSocketExtension> parseExtensions(java.lang.String extensions)
WebSocketExtension
objects.
This method can be used to parse a "Sec-WebSocket-Extension" header.
extensions
- the string to parsejava.lang.IllegalArgumentException
- if the string cannot be parsed