@Beta public static interface GenericRecord.Builder
GenericRecord instances.| Modifier and Type | Method and Description | 
|---|---|
GenericRecord | 
build()  | 
static GenericRecord.Builder | 
portable(ClassDefinition classDefinition)
Creates a Builder that will build a  
GenericRecord in Portable format with a new class definition: | 
GenericRecord.Builder | 
writeBoolean(String fieldName,
            boolean value)
It is legal to overwrite the field once only when Builder is created with  
GenericRecord.cloneWithBuilder(). | 
GenericRecord.Builder | 
writeBooleanArray(String fieldName,
                 boolean[] value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeByte(String fieldName,
         byte value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeByteArray(String fieldName,
              byte[] value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeChar(String fieldName,
         char value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeCharArray(String fieldName,
              char[] value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeDouble(String fieldName,
           double value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeDoubleArray(String fieldName,
                double[] value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeFloat(String fieldName,
          float value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeFloatArray(String fieldName,
               float[] value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeGenericRecord(String fieldName,
                  GenericRecord value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeGenericRecordArray(String fieldName,
                       GenericRecord[] value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeInt(String fieldName,
        int value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeIntArray(String fieldName,
             int[] value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeLong(String fieldName,
         long value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeLongArray(String fieldName,
              long[] value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeShort(String fieldName,
          short value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeShortArray(String fieldName,
               short[] value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeUTF(String fieldName,
        String value)
It is illegal to write to the same field twice. 
 | 
GenericRecord.Builder | 
writeUTFArray(String fieldName,
             String[] value)
It is illegal to write to the same field twice. 
 | 
@Nonnull static GenericRecord.Builder portable(@Nonnull ClassDefinition classDefinition)
GenericRecord in Portable format with a new class definition:
 
     ClassDefinition classDefinition =
                 new ClassDefinitionBuilder(FACTORY_ID, CLASS_ID)
                         .addUTFField("name").addIntField("id").build();
     GenericRecord genericRecord = GenericRecord.Builder.portable(classDefinition)
           .writeUTF("name", "foo")
           .writeInt("id", 123).build();
 classDefinition - of the portable that we will create@Nonnull GenericRecord build()
HazelcastSerializationException - when the GenericRecord cannot be build.GenericRecord.Builder writeBoolean(@Nonnull String fieldName, boolean value)
GenericRecord.cloneWithBuilder().
 Otherwise, it is illegal to write to the same field twice.fieldName - name of the field as it is defined in its class definition.
                  It should be composed of only alpha-numeric characters.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeByte(@Nonnull String fieldName, byte value)
fieldName - name of the field as it is defined in its class definition.
                  It should be composed of only alpha-numeric characters.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeChar(@Nonnull String fieldName, char value)
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeDouble(@Nonnull String fieldName, double value)
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeFloat(@Nonnull String fieldName, float value)
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeInt(@Nonnull String fieldName, int value)
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeLong(@Nonnull String fieldName, long value)
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeShort(@Nonnull String fieldName, short value)
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeUTF(@Nonnull String fieldName, @Nullable String value)
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeGenericRecord(@Nonnull String fieldName, @Nullable GenericRecord value)
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeBooleanArray(@Nonnull String fieldName, @Nullable boolean[] value)
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeByteArray(@Nonnull String fieldName, @Nullable byte[] value)
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeCharArray(@Nonnull String fieldName, @Nullable char[] value)
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeFloatArray(@Nonnull String fieldName, @Nullable float[] value)
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeIntArray(@Nonnull String fieldName, @Nullable int[] value)
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeDoubleArray(@Nonnull String fieldName, @Nullable double[] value)
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeLongArray(@Nonnull String fieldName, @Nullable long[] value)
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeShortArray(@Nonnull String fieldName, @Nullable short[] value)
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeUTFArray(@Nonnull String fieldName, @Nullable String[] value)
Array items can not be null
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().GenericRecord.Builder writeGenericRecordArray(@Nonnull String fieldName, @Nullable GenericRecord[] value)
Array items can not be null
fieldName - name of the field as it is defined in its class definition.
                  See ClassDefinition for Portablevalue - 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
                                         Same field is trying to be overwritten without using
                                         GenericRecord.cloneWithBuilder().Copyright © 2022 Hazelcast, Inc.. All rights reserved.