Package com.hazelcast.nio.serialization
Class ClassDefinitionBuilder
java.lang.Object
com.hazelcast.nio.serialization.ClassDefinitionBuilder
public final class ClassDefinitionBuilder extends Object
ClassDefinitionBuilder is used to build and register ClassDefinitions manually.
-
Constructor Summary
Constructors Constructor Description ClassDefinitionBuilder(int factoryId, int classId)
IMPORTANT: It uses a default portableVersion (0) for non-versioned classes.ClassDefinitionBuilder(int factoryId, int classId, int version)
IMPORTANT: Make sure that the version matches the portableVersion in the SerializationService -
Method Summary
-
Constructor Details
-
ClassDefinitionBuilder
public ClassDefinitionBuilder(int factoryId, int classId)IMPORTANT: It uses a default portableVersion (0) for non-versioned classes. Make sure to specify the portableVersion in the constructor if you override the default portableVersion in the SerializationService- Parameters:
factoryId
- factoryId to useclassId
- classId to use
-
ClassDefinitionBuilder
public ClassDefinitionBuilder(int factoryId, int classId, int version)IMPORTANT: Make sure that the version matches the portableVersion in the SerializationService- Parameters:
factoryId
- factoryId to useclassId
- classId to useversion
- portableVersion to use
-
-
Method Details
-
addIntField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addLongField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addUTFField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addBooleanField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addByteField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addBooleanArrayField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addCharField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addDoubleField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addFloatField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addShortField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addByteArrayField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addCharArrayField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addIntArrayField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addLongArrayField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addDoubleArrayField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addFloatArrayField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addShortArrayField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addUTFArrayField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addPortableField
- Parameters:
fieldName
- name of the field that will be added to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addPortableArrayField
public ClassDefinitionBuilder addPortableArrayField(String fieldName, ClassDefinition classDefinition)- Parameters:
fieldName
- name of the field that will be add to this class definitionclassDefinition
- class definition of the nested portable that will be add to this class definition- Returns:
- itself for chaining
- Throws:
HazelcastSerializationException
- if a field with same name already exists or if this method is called afterbuild()
-
addField
@PrivateApi public ClassDefinitionBuilder addField(com.hazelcast.internal.serialization.impl.portable.FieldDefinitionImpl fieldDefinition) -
build
- Returns:
- creates and returns a new ClassDefinition
-
getFactoryId
public int getFactoryId() -
getClassId
public int getClassId() -
getVersion
public int getVersion()
-