@ThreadSafe public final class ThriftCodecManager extends Object
| Constructor and Description |
|---|
ThriftCodecManager(ClassLoader parent,
ThriftCodec<?>... codecs) |
ThriftCodecManager(ThriftCatalog catalog) |
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.
|
<T> ThriftCodec<T> |
getCachedCodecIfPresent(Class<T> javaType) |
ThriftCodec<?> |
getCachedCodecIfPresent(ThriftType type) |
ThriftCodec<?> |
getCachedCodecIfPresent(Type javaType) |
<T> ThriftCodec<T> |
getCachedCodecIfPresent(com.google.common.reflect.TypeToken<T> type) |
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) |
ThriftCodec<?> |
getElementCodec(ThriftTypeReference thriftTypeReference) |
<T> T |
read(Class<T> type,
TProtocolReader protocol) |
Object |
read(ThriftType type,
TProtocolReader protocol) |
<T> void |
write(Class<T> type,
T value,
TProtocolWriter protocol) |
void |
write(ThriftType type,
Object value,
TProtocolWriter protocol) |
public ThriftCodecManager(ThriftCatalog catalog)
public ThriftCodecManager(ThriftCodec<?>... codecs)
public ThriftCodecManager(ClassLoader parent, 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<?> getElementCodec(ThriftTypeReference thriftTypeReference)
public ThriftCodec<?> getCodec(Type javaType)
public <T> ThriftCodec<T> getCodec(Class<T> javaType)
public <T> ThriftCodec<T> getCodec(com.google.common.reflect.TypeToken<T> type)
public ThriftCodec<?> getCodec(ThriftType type)
public ThriftCodec<?> getCachedCodecIfPresent(Type javaType)
public <T> ThriftCodec<T> getCachedCodecIfPresent(Class<T> javaType)
public <T> ThriftCodec<T> getCachedCodecIfPresent(com.google.common.reflect.TypeToken<T> type)
public ThriftCodec<?> getCachedCodecIfPresent(ThriftType type)
public void addCodec(ThriftCodec<?> codec)
public ThriftCatalog getCatalog()
public <T> T read(Class<T> type, TProtocolReader protocol) throws Exception
Exceptionpublic Object read(ThriftType type, TProtocolReader protocol) throws Exception
Exceptionpublic <T> void write(Class<T> type, T value, TProtocolWriter protocol) throws Exception
Exceptionpublic void write(ThriftType type, Object value, TProtocolWriter protocol) throws Exception
ExceptionCopyright © 2012–2019. All rights reserved.