@ThreadSafe public class ThriftCodecManager extends Object
| Constructor and Description |
|---|
ThriftCodecManager(ThriftCodec<?>... codecs) |
ThriftCodecManager(ThriftCodecFactory factory,
Set<ThriftCodec<?>> codecs) |
ThriftCodecManager(ThriftCodecFactory factory,
ThriftCatalog catalog,
Set<ThriftCodec<?>> codecs) |
ThriftCodecManager(ThriftCodecFactory factory,
ThriftCodec<?>... codecs) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCodec(ThriftCodec<?> codec)
Adds or replaces the codec associated with the type contained in the codec.
|
ThriftCatalog |
getCatalog() |
<T> ThriftCodec<T> |
getCodec(Class<T> javaType) |
ThriftCodec<?> |
getCodec(ThriftType type) |
ThriftCodec<?> |
getCodec(Type javaType) |
<T> ThriftCodec<T> |
getCodec(com.google.common.reflect.TypeToken<T> type) |
<T> T |
read(byte[] serializedStruct,
Class<T> clazz,
org.apache.thrift.protocol.TProtocolFactory protocolFactory) |
<T> T |
read(Class<T> type,
org.apache.thrift.protocol.TProtocol protocol) |
Object |
read(ThriftType type,
org.apache.thrift.protocol.TProtocol protocol) |
<T> void |
write(Class<T> type,
T value,
org.apache.thrift.protocol.TProtocol protocol) |
<T> void |
write(T ttype,
ByteArrayOutputStream oStream,
org.apache.thrift.protocol.TProtocolFactory protocolFactory) |
void |
write(ThriftType type,
Object value,
org.apache.thrift.protocol.TProtocol protocol) |
public ThriftCodecManager(ThriftCodec<?>... codecs)
public ThriftCodecManager(ThriftCodecFactory factory, ThriftCodec<?>... codecs)
public ThriftCodecManager(ThriftCodecFactory factory, Set<ThriftCodec<?>> codecs)
@Inject public ThriftCodecManager(ThriftCodecFactory factory, ThriftCatalog catalog, Set<ThriftCodec<?>> codecs)
public ThriftCodec<?> getCodec(Type javaType)
public <T> ThriftCodec<T> getCodec(Class<T> javaType)
public ThriftCodec<?> getCodec(ThriftType type)
public <T> ThriftCodec<T> getCodec(com.google.common.reflect.TypeToken<T> type)
public void addCodec(ThriftCodec<?> codec)
public ThriftCatalog getCatalog()
public <T> T read(Class<T> type, org.apache.thrift.protocol.TProtocol protocol) throws Exception
Exceptionpublic Object read(ThriftType type, org.apache.thrift.protocol.TProtocol protocol) throws Exception
Exceptionpublic <T> T read(byte[] serializedStruct,
Class<T> clazz,
org.apache.thrift.protocol.TProtocolFactory protocolFactory)
public <T> void write(Class<T> type, T value, org.apache.thrift.protocol.TProtocol protocol) throws Exception
Exceptionpublic <T> void write(T ttype,
ByteArrayOutputStream oStream,
org.apache.thrift.protocol.TProtocolFactory protocolFactory)
public void write(ThriftType type, Object value, org.apache.thrift.protocol.TProtocol protocol) throws Exception
ExceptionCopyright © 2012–2014 Facebook, Inc.. All rights reserved.