Package org.glassfish.tyrus.core
Class TyrusExtension
- java.lang.Object
-
- org.glassfish.tyrus.core.TyrusExtension
-
- All Implemented Interfaces:
java.io.Serializable
,Extension
public class TyrusExtension extends java.lang.Object implements Extension, java.io.Serializable
WebSocketExtension
implementation.- Author:
- Pavel Bucek (pavel.bucek at oracle.com)
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TyrusExtension.TyrusParameter
WebSocketExtension.Parameter
implementation.-
Nested classes/interfaces inherited from interface javax.websocket.Extension
Extension.Parameter
-
-
Constructor Summary
Constructors Constructor Description TyrusExtension(java.lang.String name)
CreateExtension
with specific name.TyrusExtension(java.lang.String name, java.util.List<Extension.Parameter> parameters)
CreateExtension
with name and parameters.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
static java.util.List<Extension>
fromHeaders(java.util.List<java.lang.String> extensionHeaders)
ParseExtension
from headers (represented asList
of strings).static java.util.List<Extension>
fromString(java.util.List<java.lang.String> s)
Parsing of oneExtension
.java.lang.String
getName()
The name of the extension.java.util.List<Extension.Parameter>
getParameters()
The extension parameters for this extension in the order they appear in the http headers.int
hashCode()
java.lang.String
toString()
-
-
-
Constructor Detail
-
TyrusExtension
public TyrusExtension(java.lang.String name)
CreateExtension
with specific name.- Parameters:
name
- extension name.- Throws:
java.lang.IllegalArgumentException
- when name is null or empty string.
-
TyrusExtension
public TyrusExtension(java.lang.String name, java.util.List<Extension.Parameter> parameters)
CreateExtension
with name and parameters.- Parameters:
name
- extension name.parameters
- extension parameters.
-
-
Method Detail
-
getName
public java.lang.String getName()
Description copied from interface:Extension
The name of the extension.
-
getParameters
public java.util.List<Extension.Parameter> getParameters()
Description copied from interface:Extension
The extension parameters for this extension in the order they appear in the http headers.- Specified by:
getParameters
in interfaceExtension
- Returns:
- The read-only Map of extension parameters belonging to this extension.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
fromString
public static java.util.List<Extension> fromString(java.util.List<java.lang.String> s)
Parsing of oneExtension
.- Parameters:
s
-List
ofString
containingExtensions
.- Returns:
- List of extensions represented as
TyrusExtension
.
-
fromHeaders
public static java.util.List<Extension> fromHeaders(java.util.List<java.lang.String> extensionHeaders)
ParseExtension
from headers (represented asList
of strings).- Parameters:
extensionHeaders
- Http Extension headers.- Returns:
- list of parsed
Extensions
.
-
-