Class ThriftSerializationFormats
java.lang.Object
com.linecorp.armeria.common.thrift.ThriftSerializationFormats
Provides Thrift-related
SerializationFormat
instances and their TProtocolFactory
s.-
Field Summary
Modifier and TypeFieldDescriptionstatic final SerializationFormat
Thrift TBinary serialization format.static final SerializationFormat
Thrift TCompact serialization format.static final SerializationFormat
Thrift TJSON serialization format.static final SerializationFormat
Thrift TText serialization format.static final SerializationFormat
Thrift TText serialization format with named enums. -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
isThrift
(SerializationFormat format) Returns whether the specifiedSerializationFormat
is Thrift.static org.apache.thrift.protocol.TProtocolFactory
protocolFactory
(SerializationFormat serializationFormat) Deprecated.static org.apache.thrift.protocol.TProtocolFactory
protocolFactory
(SerializationFormat serializationFormat, int maxStringLength, int maxContainerLength) Returns theTProtocolFactory
for the specifiedSerializationFormat
,maxStringLength
andmaxContainerLength
.static Set<SerializationFormat>
values()
Retrieves all registered Thrift serialization formats.
-
Field Details
-
BINARY
Thrift TBinary serialization format. -
COMPACT
Thrift TCompact serialization format. -
JSON
Thrift TJSON serialization format. -
TEXT
Thrift TText serialization format. This format is not optimized for performance or backwards compatibility and should only be used in non-production use cases like debugging. -
TEXT_NAMED_ENUM
Thrift TText serialization format with named enums. This format is not optimized for performance or backwards compatibility and should only be used in non-production use cases like debugging.
-
-
Method Details
-
protocolFactory
@Deprecated public static org.apache.thrift.protocol.TProtocolFactory protocolFactory(SerializationFormat serializationFormat) Deprecated.UseprotocolFactory(SerializationFormat, int, int)
instead.Returns theTProtocolFactory
for the specifiedSerializationFormat
.- Throws:
IllegalArgumentException
- if the specifiedSerializationFormat
is not a known Thrift serialization format
-
protocolFactory
public static org.apache.thrift.protocol.TProtocolFactory protocolFactory(SerializationFormat serializationFormat, int maxStringLength, int maxContainerLength) Returns theTProtocolFactory
for the specifiedSerializationFormat
,maxStringLength
andmaxContainerLength
.Note that the
maxStringLength
andmaxContainerLength
is ignored if theTProtocolFactory
does not support length limit.- Parameters:
serializationFormat
- the serialization thatTProtocolFactory
supports.maxStringLength
- the maximum allowed number of bytes to read from the transport for variable-length fields (such as strings or binary).0
means unlimited.maxContainerLength
- the maximum allowed number of containers to read from the transport for maps, sets and lists.0
means unlimited.- Throws:
IllegalArgumentException
- if the specifiedSerializationFormat
is not a known Thrift serialization format
-
values
Retrieves all registered Thrift serialization formats.- Returns:
- an view of the registered Thrift serialization formats.
-
isThrift
Returns whether the specifiedSerializationFormat
is Thrift.
-
protocolFactory(SerializationFormat, int, int)
instead.