Package com.linecorp.armeria.common
Class SerializationFormat
java.lang.Object
com.linecorp.armeria.common.SerializationFormat
- All Implemented Interfaces:
Comparable<SerializationFormat>
public final class SerializationFormat extends Object implements Comparable<SerializationFormat>
Serialization format of a remote procedure call and its reply.
-
Field Summary
Fields Modifier and Type Field Description static SerializationFormat
NONE
No serialization format.static SerializationFormat
UNKNOWN
Unknown serialization format. -
Method Summary
Modifier and Type Method Description int
compareTo(SerializationFormat o)
boolean
equals(Object obj)
static SerializationFormat
find(MediaType... ranges)
Finds theSerializationFormat
which is accepted by any of the specified media ranges.static SerializationFormat
find(String uriText)
Finds theSerializationFormat
with the specifieduriText()
.int
hashCode()
boolean
isAccepted(MediaType range)
Returns whether the specified media range is accepted by any of themediaTypes()
defined by this format.boolean
isAccepted(MediaType first, MediaType... rest)
Returns whether any of the specified media ranges is accepted by any of themediaTypes()
defined by this format.boolean
isAccepted(Iterable<MediaType> ranges)
Returns whether any of the specified media ranges is accepted by any of themediaTypes()
defined by this format.MediaType
mediaType()
Returns the primaryMediaType
of this format.MediaTypeSet
mediaTypes()
Returns the media types accepted by this format.static SerializationFormat
of(String uriText)
Returns theSerializationFormat
with the specifieduriText()
.String
toString()
String
uriText()
Returns the textual representation of this format for use in aScheme
.static Set<SerializationFormat>
values()
Returns all availableSerializationFormat
s.
-
Field Details
-
NONE
No serialization format. Used when no serialization/deserialization is desired. -
UNKNOWN
Unknown serialization format. Used when some serialization format is desired but the server failed to understand or recognize it.
-
-
Method Details
-
values
Returns all availableSerializationFormat
s. -
of
Returns theSerializationFormat
with the specifieduriText()
.- Throws:
IllegalArgumentException
- if there's no suchSerializationFormat
-
find
Finds theSerializationFormat
with the specifieduriText()
. -
find
Finds theSerializationFormat
which is accepted by any of the specified media ranges. -
uriText
Returns the textual representation of this format for use in aScheme
. -
mediaType
Returns the primaryMediaType
of this format. -
mediaTypes
Returns the media types accepted by this format. -
isAccepted
Returns whether the specified media range is accepted by any of themediaTypes()
defined by this format. -
isAccepted
Returns whether any of the specified media ranges is accepted by any of themediaTypes()
defined by this format. -
isAccepted
Returns whether any of the specified media ranges is accepted by any of themediaTypes()
defined by this format. -
hashCode
public int hashCode() -
equals
-
compareTo
- Specified by:
compareTo
in interfaceComparable<SerializationFormat>
-
toString
-