Interface GenericRecordBuilder


  • public interface GenericRecordBuilder
    Interface for creating GenericRecord instances.
    Since:
    5.2
    • Method Detail

      • portable

        @Nonnull
        static GenericRecordBuilder portable​(@Nonnull
                                             ClassDefinition classDefinition)
        Creates a Builder that will build a GenericRecord in Portable format with a new class definition:
        
         ClassDefinition classDefinition = new ClassDefinitionBuilder(FACTORY_ID, CLASS_ID)
                 .addStringField("name")
                 .addIntField("id")
                 .build();
        
         GenericRecord genericRecord = GenericRecordBuilder.portable(classDefinition)
                 .setString("name", "foo")
                 .setInt32("id", 123)
                 .build();
         
        Parameters:
        classDefinition - of the Portable that will be created
        Returns:
        GenericRecordBuilder for Portable format
      • compact

        @Nonnull
        static GenericRecordBuilder compact​(java.lang.String typeName)
        /** Creates a Builder that will build a GenericRecord in Compact format with the given type name and schema:
        
         GenericRecord genericRecord = GenericRecordBuilder.compact("typeName")
                 .setString("name", "foo")
                 .setInt32("id", 123)
                 .build();
         
        Parameters:
        typeName - of the schema
        Returns:
        GenericRecordBuilder for Compact format
      • setBoolean

        @Nonnull
        GenericRecordBuilder setBoolean​(@Nonnull
                                        java.lang.String fieldName,
                                        boolean value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setInt8

        @Nonnull
        GenericRecordBuilder setInt8​(@Nonnull
                                     java.lang.String fieldName,
                                     byte value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setChar

        @Nonnull
        GenericRecordBuilder setChar​(@Nonnull
                                     java.lang.String fieldName,
                                     char value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Supported only for Portable. Not applicable for Compact

        Parameters:
        fieldName - name of the field as it is defined in its class definition. It should be composed of only alphanumeric characters.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the class definition or the type of the field does not match the one in the class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setInt16

        @Nonnull
        GenericRecordBuilder setInt16​(@Nonnull
                                      java.lang.String fieldName,
                                      short value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setInt32

        @Nonnull
        GenericRecordBuilder setInt32​(@Nonnull
                                      java.lang.String fieldName,
                                      int value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setInt64

        @Nonnull
        GenericRecordBuilder setInt64​(@Nonnull
                                      java.lang.String fieldName,
                                      long value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setFloat32

        @Nonnull
        GenericRecordBuilder setFloat32​(@Nonnull
                                        java.lang.String fieldName,
                                        float value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setFloat64

        @Nonnull
        GenericRecordBuilder setFloat64​(@Nonnull
                                        java.lang.String fieldName,
                                        double value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setNullableBoolean

        @Nonnull
        GenericRecordBuilder setNullableBoolean​(@Nonnull
                                                java.lang.String fieldName,
                                                @Nullable
                                                java.lang.Boolean value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Supported only for Compact. Not applicable to Portable.

        Parameters:
        fieldName - name of the field as it is defined in its schema.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema or the type of the field does not match the one in the schema or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setNullableInt8

        @Nonnull
        GenericRecordBuilder setNullableInt8​(@Nonnull
                                             java.lang.String fieldName,
                                             @Nullable
                                             java.lang.Byte value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Supported only for Compact. Not applicable to Portable.

        Parameters:
        fieldName - name of the field as it is defined in its schema.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema or the type of the field does not match the one in the schema or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setNullableInt16

        @Nonnull
        GenericRecordBuilder setNullableInt16​(@Nonnull
                                              java.lang.String fieldName,
                                              @Nullable
                                              java.lang.Short value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Supported only for Compact. Not applicable to Portable.

        Parameters:
        fieldName - name of the field as it is defined in its schema.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema or the type of the field does not match the one in the schema or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setNullableInt32

        @Nonnull
        GenericRecordBuilder setNullableInt32​(@Nonnull
                                              java.lang.String fieldName,
                                              @Nullable
                                              java.lang.Integer value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Supported only for Compact. Not applicable to Portable.

        Parameters:
        fieldName - name of the field as it is defined in its schema.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema or the type of the field does not match the one in the schema or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setNullableInt64

        @Nonnull
        GenericRecordBuilder setNullableInt64​(@Nonnull
                                              java.lang.String fieldName,
                                              @Nullable
                                              java.lang.Long value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Supported only for Compact. Not applicable to Portable.

        Parameters:
        fieldName - name of the field as it is defined in its schema.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema or the type of the field does not match the one in the schema or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setNullableFloat32

        @Nonnull
        GenericRecordBuilder setNullableFloat32​(@Nonnull
                                                java.lang.String fieldName,
                                                @Nullable
                                                java.lang.Float value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Supported only for Compact. Not applicable to Portable.

        Parameters:
        fieldName - name of the field as it is defined in its schema.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema or the type of the field does not match the one in the schema or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setNullableFloat64

        @Nonnull
        GenericRecordBuilder setNullableFloat64​(@Nonnull
                                                java.lang.String fieldName,
                                                @Nullable
                                                java.lang.Double value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Supported only for Compact. Not applicable to Portable.

        Parameters:
        fieldName - name of the field as it is defined in its schema.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema or the type of the field does not match the one in the schema or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setString

        @Nonnull
        GenericRecordBuilder setString​(@Nonnull
                                       java.lang.String fieldName,
                                       @Nullable
                                       java.lang.String value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setGenericRecord

        @Nonnull
        GenericRecordBuilder setGenericRecord​(@Nonnull
                                              java.lang.String fieldName,
                                              @Nullable
                                              GenericRecord value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice. This method allows nested structures. Subclass should also be created as `GenericRecord`.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - 1. if the field name does not exist in the schema/class definition. 2. The type of the field does not match the one in the schema/class definition. 3. The same field is trying to be set without using GenericRecord.newBuilderWithClone(). 4. The type of the generic record is not the same as the generic record that is being built. e.g using portable generic record in a compact generic record builder.
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setDecimal

        @Nonnull
        GenericRecordBuilder setDecimal​(@Nonnull
                                        java.lang.String fieldName,
                                        @Nullable
                                        java.math.BigDecimal value)
        Sets a decimal which is arbitrary precision and scale floating-point number.

        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setTime

        @Nonnull
        GenericRecordBuilder setTime​(@Nonnull
                                     java.lang.String fieldName,
                                     @Nullable
                                     java.time.LocalTime value)
        Sets a time field consisting of hour, minute, seconds, and nanos parts.

        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setDate

        @Nonnull
        GenericRecordBuilder setDate​(@Nonnull
                                     java.lang.String fieldName,
                                     @Nullable
                                     java.time.LocalDate value)
        Sets a date field consisting of year, month of the year, and day of the month.

        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setTimestamp

        @Nonnull
        GenericRecordBuilder setTimestamp​(@Nonnull
                                          java.lang.String fieldName,
                                          @Nullable
                                          java.time.LocalDateTime value)
        Sets a timestamp field consisting of year, month of the year, and day of the month, hour, minute, seconds, nanos parts.

        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setTimestampWithTimezone

        @Nonnull
        GenericRecordBuilder setTimestampWithTimezone​(@Nonnull
                                                      java.lang.String fieldName,
                                                      @Nullable
                                                      java.time.OffsetDateTime value)
        Sets a timestamp with timezone field consisting of year, month of the year and day of the month, offset seconds, hour, minute, seconds, nanos parts.

        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfBoolean

        @Nonnull
        GenericRecordBuilder setArrayOfBoolean​(@Nonnull
                                               java.lang.String fieldName,
                                               @Nullable
                                               boolean[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfInt8

        @Nonnull
        GenericRecordBuilder setArrayOfInt8​(@Nonnull
                                            java.lang.String fieldName,
                                            @Nullable
                                            byte[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfChar

        @Nonnull
        GenericRecordBuilder setArrayOfChar​(@Nonnull
                                            java.lang.String fieldName,
                                            @Nullable
                                            char[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Supported only for Portable. Not applicable for Compact

        Parameters:
        fieldName - name of the field as it is defined in its class definition. It should be composed of only alphanumeric characters
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the class definition or the type of the field does not match the one in the class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfInt16

        @Nonnull
        GenericRecordBuilder setArrayOfInt16​(@Nonnull
                                             java.lang.String fieldName,
                                             @Nullable
                                             short[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfInt32

        @Nonnull
        GenericRecordBuilder setArrayOfInt32​(@Nonnull
                                             java.lang.String fieldName,
                                             @Nullable
                                             int[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfInt64

        @Nonnull
        GenericRecordBuilder setArrayOfInt64​(@Nonnull
                                             java.lang.String fieldName,
                                             @Nullable
                                             long[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfFloat32

        @Nonnull
        GenericRecordBuilder setArrayOfFloat32​(@Nonnull
                                               java.lang.String fieldName,
                                               @Nullable
                                               float[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfFloat64

        @Nonnull
        GenericRecordBuilder setArrayOfFloat64​(@Nonnull
                                               java.lang.String fieldName,
                                               @Nullable
                                               double[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfNullableBoolean

        @Nonnull
        GenericRecordBuilder setArrayOfNullableBoolean​(@Nonnull
                                                       java.lang.String fieldName,
                                                       @Nullable
                                                       java.lang.Boolean[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Supported only for Compact. Not applicable to Portable.

        Parameters:
        fieldName - name of the field as it is defined in its schema.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema or the type of the field does not match the one in the schema or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfNullableInt8

        @Nonnull
        GenericRecordBuilder setArrayOfNullableInt8​(@Nonnull
                                                    java.lang.String fieldName,
                                                    @Nullable
                                                    java.lang.Byte[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Supported only for Compact. Not applicable to Portable.

        Parameters:
        fieldName - name of the field as it is defined in its schema.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema or the type of the field does not match the one in the schema or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfNullableInt16

        @Nonnull
        GenericRecordBuilder setArrayOfNullableInt16​(@Nonnull
                                                     java.lang.String fieldName,
                                                     @Nullable
                                                     java.lang.Short[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Supported only for Compact. Not applicable to Portable.

        Parameters:
        fieldName - name of the field as it is defined in its schema.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema or the type of the field does not match the one in the schema or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfNullableInt32

        @Nonnull
        GenericRecordBuilder setArrayOfNullableInt32​(@Nonnull
                                                     java.lang.String fieldName,
                                                     @Nullable
                                                     java.lang.Integer[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Supported only for Compact. Not applicable to Portable.

        Parameters:
        fieldName - name of the field as it is defined in its schema.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema or the type of the field does not match the one in the schema or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfNullableInt64

        @Nonnull
        GenericRecordBuilder setArrayOfNullableInt64​(@Nonnull
                                                     java.lang.String fieldName,
                                                     @Nullable
                                                     java.lang.Long[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Supported only for Compact. Not applicable to Portable.

        Parameters:
        fieldName - name of the field as it is defined in its schema.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema or the type of the field does not match the one in the schema or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfNullableFloat32

        @Nonnull
        GenericRecordBuilder setArrayOfNullableFloat32​(@Nonnull
                                                       java.lang.String fieldName,
                                                       @Nullable
                                                       java.lang.Float[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Supported only for Compact. Not applicable to Portable.

        Parameters:
        fieldName - name of the field as it is defined in its schema.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema or the type of the field does not match the one in the schema or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfNullableFloat64

        @Nonnull
        GenericRecordBuilder setArrayOfNullableFloat64​(@Nonnull
                                                       java.lang.String fieldName,
                                                       @Nullable
                                                       java.lang.Double[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice.

        Supported only for Compact. Not applicable to Portable.

        Parameters:
        fieldName - name of the field as it is defined in its schema.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema or the type of the field does not match the one in the schema or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfString

        @Nonnull
        GenericRecordBuilder setArrayOfString​(@Nonnull
                                              java.lang.String fieldName,
                                              @Nullable
                                              java.lang.String[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice. Array items can not be null.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
      • setArrayOfDecimal

        @Nonnull
        GenericRecordBuilder setArrayOfDecimal​(@Nonnull
                                               java.lang.String fieldName,
                                               @Nullable
                                               java.math.BigDecimal[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice. Array items can not be null.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
        See Also:
        setDecimal(String, BigDecimal)
      • setArrayOfTime

        @Nonnull
        GenericRecordBuilder setArrayOfTime​(@Nonnull
                                            java.lang.String fieldName,
                                            @Nullable
                                            java.time.LocalTime[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice. Array items can not be null.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
        See Also:
        setTime(String, LocalTime)
      • setArrayOfDate

        @Nonnull
        GenericRecordBuilder setArrayOfDate​(@Nonnull
                                            java.lang.String fieldName,
                                            @Nullable
                                            java.time.LocalDate[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice. Array items can not be null.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
        See Also:
        setDate(String, LocalDate)
      • setArrayOfTimestamp

        @Nonnull
        GenericRecordBuilder setArrayOfTimestamp​(@Nonnull
                                                 java.lang.String fieldName,
                                                 @Nullable
                                                 java.time.LocalDateTime[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice. Array items can not be null.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
        See Also:
        setTimestamp(String, LocalDateTime)
      • setArrayOfTimestampWithTimezone

        @Nonnull
        GenericRecordBuilder setArrayOfTimestampWithTimezone​(@Nonnull
                                                             java.lang.String fieldName,
                                                             @Nullable
                                                             java.time.OffsetDateTime[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice. Array items can not be null.
        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - if the field name does not exist in the schema/class definition or the type of the field does not match the one in the schema/class definition or the same field is trying to be set without using GenericRecord.newBuilderWithClone().
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().
        See Also:
        setTimestampWithTimezone(String, OffsetDateTime)
      • setArrayOfGenericRecord

        @Nonnull
        GenericRecordBuilder setArrayOfGenericRecord​(@Nonnull
                                                     java.lang.String fieldName,
                                                     @Nullable
                                                     GenericRecord[] value)
        It is legal to set the field again only when Builder is created with GenericRecord.newBuilderWithClone(). Otherwise, it is illegal to set to the same field twice. This method allows nested structures. Subclasses should also be created as `GenericRecord`.

        Array items can not be null.

        For Compact objects, it is not allowed write an array containing different item types or a HazelcastSerializationException will be thrown.

        Parameters:
        fieldName - name of the field as it is defined in its schema/class definition. It should be composed of only alphanumeric characters for Portable GenericRecords.
        value - to set to GenericRecord
        Returns:
        itself for chaining
        Throws:
        HazelcastSerializationException - 1. if the field name does not exist in the schema/class definition. 2. The type of the field does not match the one in the schema/class definition. 3. The same field is trying to be set without using GenericRecord.newBuilderWithClone(). 4. The type of the generic record is not the same as the generic record that is being built. e.g using portable generic record in a compact generic record builder.
        java.lang.UnsupportedOperationException - if the setter is called after a GenericRecord is built by build().