Package com.linecorp.armeria.common
Class Scheme
java.lang.Object
com.linecorp.armeria.common.Scheme
- All Implemented Interfaces:
Comparable<Scheme>
public final class Scheme extends Object implements Comparable<Scheme>
A pair of
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"
-
Method Summary
Modifier and Type Method 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 theSerializationFormat
.SessionProtocol
sessionProtocol()
Returns theSessionProtocol
.String
toString()
static Scheme
tryParse(String scheme)
String
uriText()
Returns the textual representation ("serializationFormat+sessionProtocol"
).
-
Method Details
-
tryParse
-
parse
Parses the specifiedString
into aScheme
. This method will return the sameScheme
instance for equal values ofscheme
.- Throws:
IllegalArgumentException
- if the specifiedString
could not be parsed or there is no suchScheme
available
-
of
Returns theScheme
of the specifiedSerializationFormat
andSessionProtocol
. This method returns the sameScheme
instance for the same combination ofSerializationFormat
andSessionProtocol
. -
serializationFormat
Returns theSerializationFormat
. -
sessionProtocol
Returns theSessionProtocol
. -
uriText
Returns the textual representation ("serializationFormat+sessionProtocol"
). -
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Scheme>
-
toString
-