Interface GenericRecordBuilder
-
public interface GenericRecordBuilder
Interface for creatingGenericRecord
instances.- Since:
- 5.2
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description GenericRecord
build()
static GenericRecordBuilder
compact(java.lang.String typeName)
/** Creates a Builder that will build aGenericRecord
inCompact
format with the given type name and schema:static GenericRecordBuilder
portable(ClassDefinition classDefinition)
Creates a Builder that will build aGenericRecord
inPortable
format with a new class definition:GenericRecordBuilder
setArrayOfBoolean(java.lang.String fieldName, boolean[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfChar(java.lang.String fieldName, char[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfDate(java.lang.String fieldName, java.time.LocalDate[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfDecimal(java.lang.String fieldName, java.math.BigDecimal[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfFloat32(java.lang.String fieldName, float[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfFloat64(java.lang.String fieldName, double[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfGenericRecord(java.lang.String fieldName, GenericRecord[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfInt16(java.lang.String fieldName, short[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfInt32(java.lang.String fieldName, int[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfInt64(java.lang.String fieldName, long[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfInt8(java.lang.String fieldName, byte[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfNullableBoolean(java.lang.String fieldName, java.lang.Boolean[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfNullableFloat32(java.lang.String fieldName, java.lang.Float[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfNullableFloat64(java.lang.String fieldName, java.lang.Double[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfNullableInt16(java.lang.String fieldName, java.lang.Short[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfNullableInt32(java.lang.String fieldName, java.lang.Integer[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfNullableInt64(java.lang.String fieldName, java.lang.Long[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfNullableInt8(java.lang.String fieldName, java.lang.Byte[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfString(java.lang.String fieldName, java.lang.String[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfTime(java.lang.String fieldName, java.time.LocalTime[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfTimestamp(java.lang.String fieldName, java.time.LocalDateTime[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setArrayOfTimestampWithTimezone(java.lang.String fieldName, java.time.OffsetDateTime[] value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setBoolean(java.lang.String fieldName, boolean value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setChar(java.lang.String fieldName, char value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setDate(java.lang.String fieldName, java.time.LocalDate value)
Sets a date field consisting of year, month of the year, and day of the month.GenericRecordBuilder
setDecimal(java.lang.String fieldName, java.math.BigDecimal value)
Sets a decimal which is arbitrary precision and scale floating-point number.GenericRecordBuilder
setFloat32(java.lang.String fieldName, float value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setFloat64(java.lang.String fieldName, double value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setGenericRecord(java.lang.String fieldName, GenericRecord value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setInt16(java.lang.String fieldName, short value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setInt32(java.lang.String fieldName, int value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setInt64(java.lang.String fieldName, long value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setInt8(java.lang.String fieldName, byte value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setNullableBoolean(java.lang.String fieldName, java.lang.Boolean value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setNullableFloat32(java.lang.String fieldName, java.lang.Float value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setNullableFloat64(java.lang.String fieldName, java.lang.Double value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setNullableInt16(java.lang.String fieldName, java.lang.Short value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setNullableInt32(java.lang.String fieldName, java.lang.Integer value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setNullableInt64(java.lang.String fieldName, java.lang.Long value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setNullableInt8(java.lang.String fieldName, java.lang.Byte value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setString(java.lang.String fieldName, java.lang.String value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
.GenericRecordBuilder
setTime(java.lang.String fieldName, java.time.LocalTime value)
Sets a time field consisting of hour, minute, seconds, and nanos parts.GenericRecordBuilder
setTimestamp(java.lang.String fieldName, 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.GenericRecordBuilder
setTimestampWithTimezone(java.lang.String fieldName, 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.
-
-
-
Method Detail
-
portable
@Nonnull static GenericRecordBuilder portable(@Nonnull ClassDefinition classDefinition)
Creates a Builder that will build aGenericRecord
inPortable
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 aGenericRecord
inCompact
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
-
build
@Nonnull GenericRecord build()
- Returns:
- a new constructed GenericRecord
- Throws:
HazelcastSerializationException
- when the GenericRecord cannot be built.
-
setBoolean
@Nonnull GenericRecordBuilder setBoolean(@Nonnull java.lang.String fieldName, boolean value)
It is legal to set the field again only when Builder is created withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
setInt8
@Nonnull GenericRecordBuilder setInt8(@Nonnull java.lang.String fieldName, byte value)
It is legal to set the field again only when Builder is created withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
setChar
@Nonnull GenericRecordBuilder setChar(@Nonnull java.lang.String fieldName, char value)
It is legal to set the field again only when Builder is created withGenericRecord.newBuilderWithClone()
. Otherwise, it is illegal to set to the same field twice.- 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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
setInt16
@Nonnull GenericRecordBuilder setInt16(@Nonnull java.lang.String fieldName, short value)
It is legal to set the field again only when Builder is created withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
setInt32
@Nonnull GenericRecordBuilder setInt32(@Nonnull java.lang.String fieldName, int value)
It is legal to set the field again only when Builder is created withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
setInt64
@Nonnull GenericRecordBuilder setInt64(@Nonnull java.lang.String fieldName, long value)
It is legal to set the field again only when Builder is created withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
setFloat32
@Nonnull GenericRecordBuilder setFloat32(@Nonnull java.lang.String fieldName, float value)
It is legal to set the field again only when Builder is created withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
setFloat64
@Nonnull GenericRecordBuilder setFloat64(@Nonnull java.lang.String fieldName, double value)
It is legal to set the field again only when Builder is created withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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.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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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.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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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.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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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.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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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.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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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.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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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.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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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 forPortable
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 usingGenericRecord.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 bybuild()
.
-
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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.newBuilderWithClone()
. Otherwise, it is illegal to set to the same field twice.- Parameters:
fieldName
- name of the field as it is defined in its class definition. It should be composed of only alphanumeric charactersvalue
- 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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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.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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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.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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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.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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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.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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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.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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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.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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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.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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.
-
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 withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.- 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 withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.- 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 withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.- 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 withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.- 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 withGenericRecord.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 forPortable
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 usingGenericRecord.newBuilderWithClone()
.java.lang.UnsupportedOperationException
- if the setter is called after a GenericRecord is built bybuild()
.- 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 withGenericRecord.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 aHazelcastSerializationException
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 forPortable
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 usingGenericRecord.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 bybuild()
.
-
-