public enum SessionProtocol extends Enum<SessionProtocol>
| Enum Constant and Description |
|---|
H1
HTTP/1 - over TLS.
|
H1C
HTTP/1 - cleartext.
|
H2
HTTP/2 - over TLS.
|
H2C
HTTP/2 - cleartext.
|
HTTP
HTTP - cleartext, HTTP/2 preferred.
|
HTTPS
HTTP - over TLS, HTTP/2 preferred.
|
PROXY
PROXY protocol - v1 or v2.
|
| Modifier and Type | Method and Description |
|---|---|
int |
defaultPort()
Returns the default INET port number of this protocol.
|
static SessionProtocol |
find(String uriText)
Finds the
SessionProtocol with the specified uriText(). |
static Set<SessionProtocol> |
httpsValues()
|
static Set<SessionProtocol> |
httpValues()
|
boolean |
isMultiplex()
Returns
true if and only if this protocol can multiplex a single transport-layer connection into
more than one stream. |
boolean |
isTls()
Returns
true if and only if this protocol uses TLS as its transport-level security layer. |
static SessionProtocol |
of(String uriText)
Returns the
SessionProtocol with the specified uriText(). |
String |
toString() |
String |
uriText()
Returns the textual representation of this format for use in a
Scheme. |
static SessionProtocol |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SessionProtocol[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SessionProtocol HTTPS
public static final SessionProtocol HTTP
public static final SessionProtocol H1
public static final SessionProtocol H1C
public static final SessionProtocol H2
public static final SessionProtocol H2C
public static final SessionProtocol PROXY
public static SessionProtocol[] values()
for (SessionProtocol c : SessionProtocol.values()) System.out.println(c);
public static SessionProtocol 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 static SessionProtocol of(String uriText)
SessionProtocol with the specified uriText().IllegalArgumentException - if there's no such SessionProtocolpublic static SessionProtocol find(String uriText)
SessionProtocol with the specified uriText().public static Set<SessionProtocol> httpValues()
Set that contains HTTP, H1C and H2C.
Note that it does not contain HTTPS protocols such as HTTPS, H1 and H2.httpsValues()public static Set<SessionProtocol> httpsValues()
Set that contains HTTPS, H1 and H2.
Note that it does not contain HTTP protocols such as HTTP, H1C and H2C.httpValues()public boolean isTls()
true if and only if this protocol uses TLS as its transport-level security layer.public String uriText()
Scheme.public boolean isMultiplex()
true if and only if this protocol can multiplex a single transport-layer connection into
more than one stream.public int defaultPort()
public String toString()
toString in class Enum<SessionProtocol>Copyright © 2020 LeanCloud. All rights reserved.