public enum Scheme extends Enum<Scheme>
Scheme
represents a scheme used for a URI. Here
only schemes that directly relate to HTTP are provided, which
includes HTTP/1.1 schemes and WebSocket 1.0 schemes.Enum Constant and Description |
---|
HTTP
This represents the scheme for a plaintext HTTP connection.
|
HTTPS
This represents the scheme for a HTTP over TLS connection.
|
WS
This represents the scheme for a plaintext WebSocket connection.
|
WSS
This represents the scheme for WebSocket over TLS connection.
|
Modifier and Type | Field and Description |
---|---|
String |
scheme
This is the actual scheme token that is to be used in the URI.
|
boolean |
secure
This is used to determine if the connection is secure or not.
|
Modifier and Type | Method and Description |
---|---|
String |
getScheme()
This is used to acquire the scheme token for this.
|
boolean |
isSecure()
This is used to determine if the scheme is secure or not.
|
static Scheme |
resolveScheme(String token)
This is used to resolve the scheme given a token.
|
static Scheme |
resolveScheme(URI target)
This is used to resolve the scheme given a
URI . |
static Scheme |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static Scheme[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final Scheme HTTP
public static final Scheme HTTPS
public static final Scheme WS
public static final Scheme WSS
public final String scheme
public final boolean secure
public static Scheme[] values()
for (Scheme c : Scheme.values()) System.out.println(c);
public static Scheme valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean isSecure()
public String getScheme()
public static Scheme resolveScheme(String token)
token
- this is the token used to determine the schemepublic static Scheme resolveScheme(URI target)
URI
. If
there is no matching scheme for the provided instance then this
will return null.token
- this is the object to resolve a scheme forCopyright © 2022. All rights reserved.