public final class SerializationFormat extends Object implements Comparable<SerializationFormat>
| Modifier and Type | Field and Description |
|---|---|
static SerializationFormat |
NONE
No serialization format.
|
static SerializationFormat |
THRIFT_BINARY
Deprecated.
Use
ThriftSerializationFormats.BINARY. Note that the value of this field will be
null if armeria-thrift module is not loaded. |
static SerializationFormat |
THRIFT_COMPACT
Deprecated.
Use
ThriftSerializationFormats.COMPACT. Note that the value of this field will be
null if armeria-thrift module is not loaded. |
static SerializationFormat |
THRIFT_JSON
Deprecated.
Use
ThriftSerializationFormats.JSON. Note that the value of this field will be
null if armeria-thrift module is not loaded. |
static SerializationFormat |
THRIFT_TEXT
Deprecated.
Use
ThriftSerializationFormats.TEXT. Note that the value of this field will be
null if armeria-thrift module is not loaded. |
static SerializationFormat |
UNKNOWN
Unknown serialization format.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(SerializationFormat o) |
boolean |
equals(Object obj) |
static Optional<SerializationFormat> |
find(MediaType... ranges)
Finds the
SerializationFormat which is accepted by any of the specified media ranges. |
static Optional<SerializationFormat> |
find(String uriText)
Finds the
SerializationFormat with the specified uriText(). |
static Optional<SerializationFormat> |
fromMediaType(String mediaType)
Deprecated.
Use
find(MediaType...). |
int |
hashCode() |
boolean |
isAccepted(Iterable<MediaType> ranges)
Returns whether any of the specified media ranges is accepted by any of the
mediaTypes()
defined by this format. |
boolean |
isAccepted(MediaType range)
Returns whether the specified media range is accepted by any of the
mediaTypes()
defined by this format. |
boolean |
isAccepted(MediaType first,
MediaType... rest)
Returns whether any of the specified media ranges is accepted by any of the
mediaTypes()
defined by this format. |
MediaType |
mediaType()
Returns the primary
MediaType of this format. |
MediaTypeSet |
mediaTypes()
Returns the media types accepted by this format.
|
static SerializationFormat |
of(String uriText)
Returns the
SerializationFormat with the specified uriText(). |
static Set<SerializationFormat> |
ofThrift()
Deprecated.
Use
ThriftSerializationFormats.values(). |
String |
toString() |
String |
uriText()
Returns the textual representation of this format for use in a
Scheme. |
static Set<SerializationFormat> |
values()
Returns all available
SerializationFormats. |
public static final SerializationFormat NONE
public static final SerializationFormat UNKNOWN
@Nullable @Deprecated public static final SerializationFormat THRIFT_BINARY
ThriftSerializationFormats.BINARY. Note that the value of this field will be
null if armeria-thrift module is not loaded.@Nullable @Deprecated public static final SerializationFormat THRIFT_COMPACT
ThriftSerializationFormats.COMPACT. Note that the value of this field will be
null if armeria-thrift module is not loaded.@Nullable @Deprecated public static final SerializationFormat THRIFT_JSON
ThriftSerializationFormats.JSON. Note that the value of this field will be
null if armeria-thrift module is not loaded.@Nullable @Deprecated public static final SerializationFormat THRIFT_TEXT
ThriftSerializationFormats.TEXT. Note that the value of this field will be
null if armeria-thrift module is not loaded.@Deprecated public static Set<SerializationFormat> ofThrift()
ThriftSerializationFormats.values().IllegalStateException - if armeria-thrift module is not loadedpublic static Set<SerializationFormat> values()
SerializationFormats.public static SerializationFormat of(String uriText)
SerializationFormat with the specified uriText().IllegalArgumentException - if there's no such SerializationFormatpublic static Optional<SerializationFormat> find(String uriText)
SerializationFormat with the specified uriText().public static Optional<SerializationFormat> find(MediaType... ranges)
SerializationFormat which is accepted by any of the specified media ranges.@Deprecated public static Optional<SerializationFormat> fromMediaType(@Nullable String mediaType)
find(MediaType...).SerializationFormat which is accepted by the specified media range.public String uriText()
Scheme.public MediaTypeSet mediaTypes()
public boolean isAccepted(MediaType range)
mediaTypes()
defined by this format.public boolean isAccepted(MediaType first, MediaType... rest)
mediaTypes()
defined by this format.public boolean isAccepted(Iterable<MediaType> ranges)
mediaTypes()
defined by this format.public int compareTo(SerializationFormat o)
compareTo in interface Comparable<SerializationFormat>Copyright © 2020 LeanCloud. All rights reserved.