Package com.linecorp.armeria.common
Class SerializationFormat
java.lang.Object
com.linecorp.armeria.common.SerializationFormat
- All Implemented Interfaces:
Comparable<SerializationFormat>
Serialization format of a remote procedure call and its reply.
-
Field Summary
Modifier and TypeFieldDescriptionstatic SerializationFormat
No serialization format.static SerializationFormat
Unknown serialization format. -
Method Summary
Modifier and TypeMethodDescriptionint
boolean
static @Nullable SerializationFormat
Finds theSerializationFormat
which is accepted by any of the specified media ranges.static @Nullable SerializationFormat
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.Returns the primaryMediaType
of this format.Returns the media types accepted by this format.static SerializationFormat
Returns theSerializationFormat
with the specifieduriText()
.toString()
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
-