public final class Scheme extends Object implements Comparable<Scheme>
SerializationFormat and SessionProtocol.
A Scheme is represented and used as the scheme of a URI in the following format:
SerializationFormat.uriText() + '+' + SessionProtocol.uriText()
For example:
"tbinary+https""tcompact+h2c""none+http"| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Scheme o) |
boolean |
equals(Object obj) |
int |
hashCode() |
static Scheme |
of(SerializationFormat serializationFormat,
SessionProtocol sessionProtocol)
|
static Scheme |
parse(String scheme)
|
SerializationFormat |
serializationFormat()
Returns the
SerializationFormat. |
SessionProtocol |
sessionProtocol()
Returns the
SessionProtocol. |
String |
toString() |
static Scheme |
tryParse(String scheme)
|
String |
uriText()
Returns the textual representation (
"serializationFormat+sessionProtocol"). |
public static Scheme parse(String scheme)
String into a Scheme. This method will return the same
Scheme instance for equal values of scheme.IllegalArgumentException - if the specified String could not be parsed or
there is no such Scheme availablepublic static Scheme of(SerializationFormat serializationFormat, SessionProtocol sessionProtocol)
Scheme of the specified SerializationFormat and SessionProtocol.
This method returns the same Scheme instance for the same combination of
SerializationFormat and SessionProtocol.public SerializationFormat serializationFormat()
SerializationFormat.public SessionProtocol sessionProtocol()
SessionProtocol.public String uriText()
"serializationFormat+sessionProtocol").public int compareTo(Scheme o)
compareTo in interface Comparable<Scheme>Copyright © 2020 LeanCloud. All rights reserved.