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
FieldsModifier and TypeFieldDescriptionstatic SerializationFormatNo serialization format.static SerializationFormatUnknown serialization format. -
Method Summary
Modifier and TypeMethodDescriptionintbooleanstatic @Nullable SerializationFormatFinds theSerializationFormatwhich is accepted by any of the specified media ranges.static @Nullable SerializationFormatFinds theSerializationFormatwith the specifieduriText().inthashCode()booleanisAccepted(MediaType range)Returns whether the specified media range is accepted by any of themediaTypes()defined by this format.booleanisAccepted(MediaType first, MediaType... rest)Returns whether any of the specified media ranges is accepted by any of themediaTypes()defined by this format.booleanisAccepted(Iterable<MediaType> ranges)Returns whether any of the specified media ranges is accepted by any of themediaTypes()defined by this format.Returns the primaryMediaTypeof this format.Returns the media types accepted by this format.static SerializationFormatReturns theSerializationFormatwith the specifieduriText().toString()uriText()Returns the textual representation of this format for use in aScheme.static Set<SerializationFormat>values()Returns all availableSerializationFormats.
-
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 availableSerializationFormats. -
of
Returns theSerializationFormatwith the specifieduriText().- Throws:
IllegalArgumentException- if there's no suchSerializationFormat
-
find
Finds theSerializationFormatwith the specifieduriText(). -
find
Finds theSerializationFormatwhich is accepted by any of the specified media ranges. -
uriText
Returns the textual representation of this format for use in aScheme. -
mediaType
Returns the primaryMediaTypeof 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:
compareToin interfaceComparable<SerializationFormat>
-
toString
-