Class ClassDefinitionBuilder

java.lang.Object
com.hazelcast.nio.serialization.ClassDefinitionBuilder

@Deprecated(since="5.4", forRemoval=true) public final class ClassDefinitionBuilder extends Object
Deprecated, for removal: This API element is subject to removal in a future version.
Portable Serialization has been deprecated. We recommend you use Compact Serialization as Portable Serialization will be removed as of version 7.0.
ClassDefinitionBuilder is used to build and register ClassDefinitions manually.
See Also:
  • Constructor Details

    • ClassDefinitionBuilder

      public ClassDefinitionBuilder(int factoryId, int classId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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
    • ClassDefinitionBuilder

      public ClassDefinitionBuilder(int factoryId, int classId, int version)
      Deprecated, for removal: This API element is subject to removal in a future version.
      IMPORTANT: Make sure that the version matches the portableVersion in the SerializationService
    • ClassDefinitionBuilder

      public ClassDefinitionBuilder(PortableId portableId)
      Deprecated, for removal: This API element is subject to removal in a future version.
      IMPORTANT: Make sure that the version matches the portableVersion in the SerializationService
      Since:
      5.4
  • Method Details

    • addIntField

      @Nonnull public ClassDefinitionBuilder addIntField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addLongField

      @Nonnull public ClassDefinitionBuilder addLongField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addUTFField

      @Nonnull @Deprecated public ClassDefinitionBuilder addUTFField(@Nonnull String fieldName)
      Deprecated.
      for the sake of better naming. Use addStringField(String) instead.
      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 after build()
    • addStringField

      @Nonnull public ClassDefinitionBuilder addStringField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addBooleanField

      @Nonnull public ClassDefinitionBuilder addBooleanField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addByteField

      @Nonnull public ClassDefinitionBuilder addByteField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addBooleanArrayField

      @Nonnull public ClassDefinitionBuilder addBooleanArrayField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addCharField

      @Nonnull public ClassDefinitionBuilder addCharField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addDoubleField

      @Nonnull public ClassDefinitionBuilder addDoubleField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addFloatField

      @Nonnull public ClassDefinitionBuilder addFloatField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addShortField

      @Nonnull public ClassDefinitionBuilder addShortField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addDecimalField

      @Nonnull public ClassDefinitionBuilder addDecimalField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds a decimal which is arbitrary precision and scale floating-point number to the class definition
      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 after build()
    • addTimeField

      @Nonnull public ClassDefinitionBuilder addTimeField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds a time field consisting of hour, minute, seconds and nanos parts to the class definition
      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 after build()
    • addDateField

      @Nonnull public ClassDefinitionBuilder addDateField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds a date field consisting of year, month of the year and day of the month to the class definition
      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 after build()
    • addTimestampField

      @Nonnull public ClassDefinitionBuilder addTimestampField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds a timestamp field consisting of year, month of the year, day of the month, hour, minute, seconds, nanos parts to the class definition
      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 after build()
    • addTimestampWithTimezoneField

      @Nonnull public ClassDefinitionBuilder addTimestampWithTimezoneField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds a timestamp with timezone field consisting of year, month of the year, day of the month, offset seconds, hour, minute, seconds, nanos parts to the class definition
      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 after build()
    • addByteArrayField

      @Nonnull public ClassDefinitionBuilder addByteArrayField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addCharArrayField

      @Nonnull public ClassDefinitionBuilder addCharArrayField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addIntArrayField

      @Nonnull public ClassDefinitionBuilder addIntArrayField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addLongArrayField

      @Nonnull public ClassDefinitionBuilder addLongArrayField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addDoubleArrayField

      @Nonnull public ClassDefinitionBuilder addDoubleArrayField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addFloatArrayField

      @Nonnull public ClassDefinitionBuilder addFloatArrayField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addShortArrayField

      @Nonnull public ClassDefinitionBuilder addShortArrayField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addUTFArrayField

      @Nonnull @Deprecated public ClassDefinitionBuilder addUTFArrayField(@Nonnull String fieldName)
      Deprecated.
      for the sake of better naming. Use addStringArrayField(String) instead.
      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 after build()
    • addStringArrayField

      @Nonnull public ClassDefinitionBuilder addStringArrayField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addPortableField

      @Nonnull public ClassDefinitionBuilder addPortableField(@Nonnull String fieldName, ClassDefinition classDefinition)
      Deprecated, for removal: This API element is subject to removal in a future version.
      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 after build()
    • addPortableArrayField

      @Nonnull public ClassDefinitionBuilder addPortableArrayField(@Nonnull String fieldName, ClassDefinition classDefinition)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Parameters:
      fieldName - name of the field that will be added to this class definition
      classDefinition - class definition of the nested portable 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 after build()
    • addDecimalArrayField

      @Nonnull public ClassDefinitionBuilder addDecimalArrayField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds an array of Decimal's to the class definition
      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 after build()
      See Also:
    • addTimeArrayField

      @Nonnull public ClassDefinitionBuilder addTimeArrayField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds an array of Time's to the class definition
      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 after build()
      See Also:
    • addDateArrayField

      @Nonnull public ClassDefinitionBuilder addDateArrayField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds an array of Date's to the class definition
      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 after build()
      See Also:
    • addTimestampArrayField

      @Nonnull public ClassDefinitionBuilder addTimestampArrayField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds an array of Timestamp's to the class definition
      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 after build()
      See Also:
    • addTimestampWithTimezoneArrayField

      @Nonnull public ClassDefinitionBuilder addTimestampWithTimezoneArrayField(@Nonnull String fieldName)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Adds an array of TimestampWithTimezone's to the class definition
      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 after build()
      See Also:
    • addField

      @PrivateApi public void addField(com.hazelcast.internal.serialization.impl.portable.FieldDefinitionImpl fieldDefinition)
      Deprecated, for removal: This API element is subject to removal in a future version.
    • build

      @Nonnull public ClassDefinition build()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Returns:
      creates and returns a new ClassDefinition
    • getFactoryId

      public int getFactoryId()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getClassId

      public int getClassId()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getVersion

      public int getVersion()
      Deprecated, for removal: This API element is subject to removal in a future version.
    • getPortableId

      public PortableId getPortableId()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Since:
      5.4