public class HazelcastSerializer<T> extends Object implements com.hazelcast.nio.serialization.StreamSerializer<T>, com.hazelcast.nio.serialization.TypedStreamDeserializer<T>
| Constructor and Description |
|---|
HazelcastSerializer(int typeId,
SerializationHandle<T> serializationHandle) |
HazelcastSerializer(SerializationHandle<T> serializationHandle) |
| Modifier and Type | Method and Description |
|---|---|
static void |
addCustomSerializers(com.hazelcast.config.SerializationConfig serializationConfig,
int typeIdBase)
Registers custom Hazelcast serializers for all classes from Bucket4j library which can be transferred over network.
|
void |
destroy() |
static List<HazelcastSerializer<?>> |
getAllSerializers(int typeIdBase)
Returns the list custom Hazelcast serializers for all classes from Bucket4j library which can be transferred over network.
|
Class<T> |
getSerializableType() |
int |
getTypeId() |
T |
read(com.hazelcast.nio.ObjectDataInput in) |
T |
read(com.hazelcast.nio.ObjectDataInput in,
Class aClass) |
HazelcastSerializer<T> |
withBaseTypeId(int baseTypeId) |
void |
write(com.hazelcast.nio.ObjectDataOutput out,
T serializable) |
public HazelcastSerializer(int typeId,
SerializationHandle<T> serializationHandle)
public HazelcastSerializer(SerializationHandle<T> serializationHandle)
public static void addCustomSerializers(com.hazelcast.config.SerializationConfig serializationConfig,
int typeIdBase)
Note: it would be better to leave an empty space in the Ids in order to handle the extension of Bucket4j library when new classes can be added to library.
For example if you called getAllSerializers(10000) then it would be reasonable to avoid registering your custom types in the interval 10000-10100.
typeIdBase - a starting number from for typeId sequencepublic static List<HazelcastSerializer<?>> getAllSerializers(int typeIdBase)
Note: it would be better to leave an empty space in the Ids in order to handle the extension of Bucket4j library when new classes can be added to library.
For example if you called getAllSerializers(10000) then it would be reasonable to avoid registering your custom types in the interval 10000-10100.
typeIdBase - a starting number from for typeId sequencepublic HazelcastSerializer<T> withBaseTypeId(int baseTypeId)
public int getTypeId()
getTypeId in interface com.hazelcast.nio.serialization.Serializerpublic void destroy()
destroy in interface com.hazelcast.nio.serialization.Serializerpublic void write(com.hazelcast.nio.ObjectDataOutput out,
T serializable)
throws IOException
write in interface com.hazelcast.nio.serialization.StreamSerializer<T>IOExceptionpublic T read(com.hazelcast.nio.ObjectDataInput in) throws IOException
read in interface com.hazelcast.nio.serialization.StreamSerializer<T>IOExceptionpublic T read(com.hazelcast.nio.ObjectDataInput in, Class aClass) throws IOException
read in interface com.hazelcast.nio.serialization.TypedStreamDeserializer<T>IOExceptionCopyright © 2021. All rights reserved.