Package com.tangosol.io.pof.reflect
Class Codecs
- java.lang.Object
-
- com.tangosol.io.pof.reflect.Codecs
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCodecs.AbstractCodecAbstractCodecimplementations that encodes objects by simply delegating toPofWriter.writeObject(int, Object).static classCodecs.ArrayCodecImplementation ofCodecthat delegates toPofReader.readObjectArray(int, Object[])andPofWriter.writeObjectArray(int, Object[])to deserialize and serialize an object.static classCodecs.CollectionCodecImplementation ofCodecthat delegates toPofReader.readCollection(int, Collection)andPofWriter.writeCollection(int, Collection)to deserialize and serialize an object.static classCodecs.DefaultCodecImplementation ofCodecthat simply delegates toPofReader.readObject(int)andPofWriter.writeObject(int, Object)to deserialize and serialize an object.static classCodecs.LongArrayCodecImplementation ofCodecthat delegates toPofReader.readLongArray(int, LongArray)andPofWriter.writeLongArray(int, LongArray)to deserialize and serialize an object.static classCodecs.MapCodecImplementation ofCodecthat delegates toPofReader.readMap(int, Map)andPofWriter.writeMap(int, Map)to deserialize and serialize an object.
-
Field Summary
Fields Modifier and Type Field Description static CodecDEFAULT_CODECA singleton instance of aCodecs.DefaultCodec
-
Constructor Summary
Constructors Constructor Description Codecs()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static CodecgetCodec(Class<?> clz)Return aCodecbased on the provided Class.
-
-
-
Field Detail
-
DEFAULT_CODEC
public static final Codec DEFAULT_CODEC
A singleton instance of aCodecs.DefaultCodec
-
-
Method Detail
-
getCodec
public static Codec getCodec(Class<?> clz)
Return aCodecbased on the provided Class.The provided Class should implement one of:
- Codec - the Codec implementation should have a no-arg constructor which will be instantiated and returned.
- Collection - the provided class should implement the
Collectioninterface and have a no-arg constructor. A Codec supporting Collections will be returned - Map - the provided class should implement the
Mapinterface and have a no-arg constructor. A Codec supporting Maps will be returned - LongArray - the provided class should implement the
LongArrayinterface and have a no-arg constructor. A Codec supporting LongArrays will be returned - T[] - the provided class should be an array and the component type of the array should have a no-arg constructor. A Codec supporting arrays will be returned
- Parameters:
clz- a Class that implements Codec or is one of the supported types- Returns:
- a Codec that supports encoding and decoding of objects of the specified type
-
-