public final class ClassDefinitionBuilder extends Object
Constructor and 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
|
public ClassDefinitionBuilder(int factoryId, int classId)
factoryId
- factoryId to useclassId
- classId to usepublic ClassDefinitionBuilder(int factoryId, int classId, int version)
factoryId
- factoryId to useclassId
- classId to useversion
- portableVersion to usepublic ClassDefinitionBuilder addIntField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addLongField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addUTFField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addBooleanField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addByteField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addBooleanArrayField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addCharField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addDoubleField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addFloatField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addShortField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addByteArrayField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addCharArrayField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addIntArrayField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addLongArrayField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addDoubleArrayField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addFloatArrayField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addShortArrayField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addUTFArrayField(String fieldName)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addPortableField(String fieldName, ClassDefinition def)
fieldName
- name of the field that will be added to this class definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
public ClassDefinitionBuilder addPortableArrayField(String fieldName, ClassDefinition classDefinition)
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 definitionHazelcastSerializationException
- if a field with same name already exists or
if this method is called after build()
@PrivateApi public ClassDefinitionBuilder addField(com.hazelcast.internal.serialization.impl.portable.FieldDefinitionImpl fieldDefinition)
public ClassDefinition build()
public int getFactoryId()
public int getClassId()
public int getVersion()
Copyright © 2022 Hazelcast, Inc.. All rights reserved.