Class Mutation.Builder

  • All Implemented Interfaces:
    com.google.protobuf.Message.Builder, com.google.protobuf.MessageLite.Builder, com.google.protobuf.MessageLiteOrBuilder, com.google.protobuf.MessageOrBuilder, MutationOrBuilder, Cloneable
    Enclosing class:
    Mutation

    public static final class Mutation.Builder
    extends com.google.protobuf.GeneratedMessageV3.Builder<Mutation.Builder>
    implements MutationOrBuilder
     A modification to one or more Cloud Spanner rows.  Mutations can be
     applied to a Cloud Spanner database by sending them in a
     [Commit][google.spanner.v1.Spanner.Commit] call.
     
    Protobuf type google.spanner.v1.Mutation
    • Method Detail

      • getDescriptor

        public static final com.google.protobuf.Descriptors.Descriptor getDescriptor()
      • internalGetFieldAccessorTable

        protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internalGetFieldAccessorTable()
        Specified by:
        internalGetFieldAccessorTable in class com.google.protobuf.GeneratedMessageV3.Builder<Mutation.Builder>
      • clear

        public Mutation.Builder clear()
        Specified by:
        clear in interface com.google.protobuf.Message.Builder
        Specified by:
        clear in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clear in class com.google.protobuf.GeneratedMessageV3.Builder<Mutation.Builder>
      • getDescriptorForType

        public com.google.protobuf.Descriptors.Descriptor getDescriptorForType()
        Specified by:
        getDescriptorForType in interface com.google.protobuf.Message.Builder
        Specified by:
        getDescriptorForType in interface com.google.protobuf.MessageOrBuilder
        Overrides:
        getDescriptorForType in class com.google.protobuf.GeneratedMessageV3.Builder<Mutation.Builder>
      • getDefaultInstanceForType

        public Mutation getDefaultInstanceForType()
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageLiteOrBuilder
        Specified by:
        getDefaultInstanceForType in interface com.google.protobuf.MessageOrBuilder
      • build

        public Mutation build()
        Specified by:
        build in interface com.google.protobuf.Message.Builder
        Specified by:
        build in interface com.google.protobuf.MessageLite.Builder
      • buildPartial

        public Mutation buildPartial()
        Specified by:
        buildPartial in interface com.google.protobuf.Message.Builder
        Specified by:
        buildPartial in interface com.google.protobuf.MessageLite.Builder
      • clone

        public Mutation.Builder clone()
        Specified by:
        clone in interface com.google.protobuf.Message.Builder
        Specified by:
        clone in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        clone in class com.google.protobuf.GeneratedMessageV3.Builder<Mutation.Builder>
      • setField

        public Mutation.Builder setField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                         Object value)
        Specified by:
        setField in interface com.google.protobuf.Message.Builder
        Overrides:
        setField in class com.google.protobuf.GeneratedMessageV3.Builder<Mutation.Builder>
      • clearField

        public Mutation.Builder clearField​(com.google.protobuf.Descriptors.FieldDescriptor field)
        Specified by:
        clearField in interface com.google.protobuf.Message.Builder
        Overrides:
        clearField in class com.google.protobuf.GeneratedMessageV3.Builder<Mutation.Builder>
      • clearOneof

        public Mutation.Builder clearOneof​(com.google.protobuf.Descriptors.OneofDescriptor oneof)
        Specified by:
        clearOneof in interface com.google.protobuf.Message.Builder
        Overrides:
        clearOneof in class com.google.protobuf.GeneratedMessageV3.Builder<Mutation.Builder>
      • setRepeatedField

        public Mutation.Builder setRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                 int index,
                                                 Object value)
        Specified by:
        setRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        setRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Mutation.Builder>
      • addRepeatedField

        public Mutation.Builder addRepeatedField​(com.google.protobuf.Descriptors.FieldDescriptor field,
                                                 Object value)
        Specified by:
        addRepeatedField in interface com.google.protobuf.Message.Builder
        Overrides:
        addRepeatedField in class com.google.protobuf.GeneratedMessageV3.Builder<Mutation.Builder>
      • mergeFrom

        public Mutation.Builder mergeFrom​(com.google.protobuf.Message other)
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Mutation.Builder>
      • isInitialized

        public final boolean isInitialized()
        Specified by:
        isInitialized in interface com.google.protobuf.MessageLiteOrBuilder
        Overrides:
        isInitialized in class com.google.protobuf.GeneratedMessageV3.Builder<Mutation.Builder>
      • mergeFrom

        public Mutation.Builder mergeFrom​(com.google.protobuf.CodedInputStream input,
                                          com.google.protobuf.ExtensionRegistryLite extensionRegistry)
                                   throws IOException
        Specified by:
        mergeFrom in interface com.google.protobuf.Message.Builder
        Specified by:
        mergeFrom in interface com.google.protobuf.MessageLite.Builder
        Overrides:
        mergeFrom in class com.google.protobuf.AbstractMessage.Builder<Mutation.Builder>
        Throws:
        IOException
      • hasInsert

        public boolean hasInsert()
         Insert new rows in a table. If any of the rows already exist,
         the write or transaction fails with error `ALREADY_EXISTS`.
         
        .google.spanner.v1.Mutation.Write insert = 1;
        Specified by:
        hasInsert in interface MutationOrBuilder
        Returns:
        Whether the insert field is set.
      • getInsert

        public Mutation.Write getInsert()
         Insert new rows in a table. If any of the rows already exist,
         the write or transaction fails with error `ALREADY_EXISTS`.
         
        .google.spanner.v1.Mutation.Write insert = 1;
        Specified by:
        getInsert in interface MutationOrBuilder
        Returns:
        The insert.
      • setInsert

        public Mutation.Builder setInsert​(Mutation.Write value)
         Insert new rows in a table. If any of the rows already exist,
         the write or transaction fails with error `ALREADY_EXISTS`.
         
        .google.spanner.v1.Mutation.Write insert = 1;
      • setInsert

        public Mutation.Builder setInsert​(Mutation.Write.Builder builderForValue)
         Insert new rows in a table. If any of the rows already exist,
         the write or transaction fails with error `ALREADY_EXISTS`.
         
        .google.spanner.v1.Mutation.Write insert = 1;
      • mergeInsert

        public Mutation.Builder mergeInsert​(Mutation.Write value)
         Insert new rows in a table. If any of the rows already exist,
         the write or transaction fails with error `ALREADY_EXISTS`.
         
        .google.spanner.v1.Mutation.Write insert = 1;
      • clearInsert

        public Mutation.Builder clearInsert()
         Insert new rows in a table. If any of the rows already exist,
         the write or transaction fails with error `ALREADY_EXISTS`.
         
        .google.spanner.v1.Mutation.Write insert = 1;
      • getInsertBuilder

        public Mutation.Write.Builder getInsertBuilder()
         Insert new rows in a table. If any of the rows already exist,
         the write or transaction fails with error `ALREADY_EXISTS`.
         
        .google.spanner.v1.Mutation.Write insert = 1;
      • getInsertOrBuilder

        public Mutation.WriteOrBuilder getInsertOrBuilder()
         Insert new rows in a table. If any of the rows already exist,
         the write or transaction fails with error `ALREADY_EXISTS`.
         
        .google.spanner.v1.Mutation.Write insert = 1;
        Specified by:
        getInsertOrBuilder in interface MutationOrBuilder
      • hasUpdate

        public boolean hasUpdate()
         Update existing rows in a table. If any of the rows does not
         already exist, the transaction fails with error `NOT_FOUND`.
         
        .google.spanner.v1.Mutation.Write update = 2;
        Specified by:
        hasUpdate in interface MutationOrBuilder
        Returns:
        Whether the update field is set.
      • getUpdate

        public Mutation.Write getUpdate()
         Update existing rows in a table. If any of the rows does not
         already exist, the transaction fails with error `NOT_FOUND`.
         
        .google.spanner.v1.Mutation.Write update = 2;
        Specified by:
        getUpdate in interface MutationOrBuilder
        Returns:
        The update.
      • setUpdate

        public Mutation.Builder setUpdate​(Mutation.Write value)
         Update existing rows in a table. If any of the rows does not
         already exist, the transaction fails with error `NOT_FOUND`.
         
        .google.spanner.v1.Mutation.Write update = 2;
      • setUpdate

        public Mutation.Builder setUpdate​(Mutation.Write.Builder builderForValue)
         Update existing rows in a table. If any of the rows does not
         already exist, the transaction fails with error `NOT_FOUND`.
         
        .google.spanner.v1.Mutation.Write update = 2;
      • mergeUpdate

        public Mutation.Builder mergeUpdate​(Mutation.Write value)
         Update existing rows in a table. If any of the rows does not
         already exist, the transaction fails with error `NOT_FOUND`.
         
        .google.spanner.v1.Mutation.Write update = 2;
      • clearUpdate

        public Mutation.Builder clearUpdate()
         Update existing rows in a table. If any of the rows does not
         already exist, the transaction fails with error `NOT_FOUND`.
         
        .google.spanner.v1.Mutation.Write update = 2;
      • getUpdateBuilder

        public Mutation.Write.Builder getUpdateBuilder()
         Update existing rows in a table. If any of the rows does not
         already exist, the transaction fails with error `NOT_FOUND`.
         
        .google.spanner.v1.Mutation.Write update = 2;
      • getUpdateOrBuilder

        public Mutation.WriteOrBuilder getUpdateOrBuilder()
         Update existing rows in a table. If any of the rows does not
         already exist, the transaction fails with error `NOT_FOUND`.
         
        .google.spanner.v1.Mutation.Write update = 2;
        Specified by:
        getUpdateOrBuilder in interface MutationOrBuilder
      • hasInsertOrUpdate

        public boolean hasInsertOrUpdate()
         Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then
         its column values are overwritten with the ones provided. Any
         column values not explicitly written are preserved.
        
         When using [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as when using [insert][google.spanner.v1.Mutation.insert], all `NOT
         NULL` columns in the table must be given a value. This holds true
         even when the row already exists and will therefore actually be updated.
         
        .google.spanner.v1.Mutation.Write insert_or_update = 3;
        Specified by:
        hasInsertOrUpdate in interface MutationOrBuilder
        Returns:
        Whether the insertOrUpdate field is set.
      • getInsertOrUpdate

        public Mutation.Write getInsertOrUpdate()
         Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then
         its column values are overwritten with the ones provided. Any
         column values not explicitly written are preserved.
        
         When using [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as when using [insert][google.spanner.v1.Mutation.insert], all `NOT
         NULL` columns in the table must be given a value. This holds true
         even when the row already exists and will therefore actually be updated.
         
        .google.spanner.v1.Mutation.Write insert_or_update = 3;
        Specified by:
        getInsertOrUpdate in interface MutationOrBuilder
        Returns:
        The insertOrUpdate.
      • setInsertOrUpdate

        public Mutation.Builder setInsertOrUpdate​(Mutation.Write value)
         Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then
         its column values are overwritten with the ones provided. Any
         column values not explicitly written are preserved.
        
         When using [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as when using [insert][google.spanner.v1.Mutation.insert], all `NOT
         NULL` columns in the table must be given a value. This holds true
         even when the row already exists and will therefore actually be updated.
         
        .google.spanner.v1.Mutation.Write insert_or_update = 3;
      • setInsertOrUpdate

        public Mutation.Builder setInsertOrUpdate​(Mutation.Write.Builder builderForValue)
         Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then
         its column values are overwritten with the ones provided. Any
         column values not explicitly written are preserved.
        
         When using [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as when using [insert][google.spanner.v1.Mutation.insert], all `NOT
         NULL` columns in the table must be given a value. This holds true
         even when the row already exists and will therefore actually be updated.
         
        .google.spanner.v1.Mutation.Write insert_or_update = 3;
      • mergeInsertOrUpdate

        public Mutation.Builder mergeInsertOrUpdate​(Mutation.Write value)
         Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then
         its column values are overwritten with the ones provided. Any
         column values not explicitly written are preserved.
        
         When using [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as when using [insert][google.spanner.v1.Mutation.insert], all `NOT
         NULL` columns in the table must be given a value. This holds true
         even when the row already exists and will therefore actually be updated.
         
        .google.spanner.v1.Mutation.Write insert_or_update = 3;
      • clearInsertOrUpdate

        public Mutation.Builder clearInsertOrUpdate()
         Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then
         its column values are overwritten with the ones provided. Any
         column values not explicitly written are preserved.
        
         When using [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as when using [insert][google.spanner.v1.Mutation.insert], all `NOT
         NULL` columns in the table must be given a value. This holds true
         even when the row already exists and will therefore actually be updated.
         
        .google.spanner.v1.Mutation.Write insert_or_update = 3;
      • getInsertOrUpdateBuilder

        public Mutation.Write.Builder getInsertOrUpdateBuilder()
         Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then
         its column values are overwritten with the ones provided. Any
         column values not explicitly written are preserved.
        
         When using [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as when using [insert][google.spanner.v1.Mutation.insert], all `NOT
         NULL` columns in the table must be given a value. This holds true
         even when the row already exists and will therefore actually be updated.
         
        .google.spanner.v1.Mutation.Write insert_or_update = 3;
      • getInsertOrUpdateOrBuilder

        public Mutation.WriteOrBuilder getInsertOrUpdateOrBuilder()
         Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, then
         its column values are overwritten with the ones provided. Any
         column values not explicitly written are preserved.
        
         When using [insert_or_update][google.spanner.v1.Mutation.insert_or_update], just as when using [insert][google.spanner.v1.Mutation.insert], all `NOT
         NULL` columns in the table must be given a value. This holds true
         even when the row already exists and will therefore actually be updated.
         
        .google.spanner.v1.Mutation.Write insert_or_update = 3;
        Specified by:
        getInsertOrUpdateOrBuilder in interface MutationOrBuilder
      • hasReplace

        public boolean hasReplace()
         Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, it is
         deleted, and the column values provided are inserted
         instead. Unlike [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this means any values not
         explicitly written become `NULL`.
        
         In an interleaved table, if you create the child table with the
         `ON DELETE CASCADE` annotation, then replacing a parent row
         also deletes the child rows. Otherwise, you must delete the
         child rows before you replace the parent row.
         
        .google.spanner.v1.Mutation.Write replace = 4;
        Specified by:
        hasReplace in interface MutationOrBuilder
        Returns:
        Whether the replace field is set.
      • getReplace

        public Mutation.Write getReplace()
         Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, it is
         deleted, and the column values provided are inserted
         instead. Unlike [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this means any values not
         explicitly written become `NULL`.
        
         In an interleaved table, if you create the child table with the
         `ON DELETE CASCADE` annotation, then replacing a parent row
         also deletes the child rows. Otherwise, you must delete the
         child rows before you replace the parent row.
         
        .google.spanner.v1.Mutation.Write replace = 4;
        Specified by:
        getReplace in interface MutationOrBuilder
        Returns:
        The replace.
      • setReplace

        public Mutation.Builder setReplace​(Mutation.Write value)
         Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, it is
         deleted, and the column values provided are inserted
         instead. Unlike [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this means any values not
         explicitly written become `NULL`.
        
         In an interleaved table, if you create the child table with the
         `ON DELETE CASCADE` annotation, then replacing a parent row
         also deletes the child rows. Otherwise, you must delete the
         child rows before you replace the parent row.
         
        .google.spanner.v1.Mutation.Write replace = 4;
      • setReplace

        public Mutation.Builder setReplace​(Mutation.Write.Builder builderForValue)
         Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, it is
         deleted, and the column values provided are inserted
         instead. Unlike [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this means any values not
         explicitly written become `NULL`.
        
         In an interleaved table, if you create the child table with the
         `ON DELETE CASCADE` annotation, then replacing a parent row
         also deletes the child rows. Otherwise, you must delete the
         child rows before you replace the parent row.
         
        .google.spanner.v1.Mutation.Write replace = 4;
      • mergeReplace

        public Mutation.Builder mergeReplace​(Mutation.Write value)
         Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, it is
         deleted, and the column values provided are inserted
         instead. Unlike [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this means any values not
         explicitly written become `NULL`.
        
         In an interleaved table, if you create the child table with the
         `ON DELETE CASCADE` annotation, then replacing a parent row
         also deletes the child rows. Otherwise, you must delete the
         child rows before you replace the parent row.
         
        .google.spanner.v1.Mutation.Write replace = 4;
      • clearReplace

        public Mutation.Builder clearReplace()
         Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, it is
         deleted, and the column values provided are inserted
         instead. Unlike [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this means any values not
         explicitly written become `NULL`.
        
         In an interleaved table, if you create the child table with the
         `ON DELETE CASCADE` annotation, then replacing a parent row
         also deletes the child rows. Otherwise, you must delete the
         child rows before you replace the parent row.
         
        .google.spanner.v1.Mutation.Write replace = 4;
      • getReplaceBuilder

        public Mutation.Write.Builder getReplaceBuilder()
         Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, it is
         deleted, and the column values provided are inserted
         instead. Unlike [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this means any values not
         explicitly written become `NULL`.
        
         In an interleaved table, if you create the child table with the
         `ON DELETE CASCADE` annotation, then replacing a parent row
         also deletes the child rows. Otherwise, you must delete the
         child rows before you replace the parent row.
         
        .google.spanner.v1.Mutation.Write replace = 4;
      • getReplaceOrBuilder

        public Mutation.WriteOrBuilder getReplaceOrBuilder()
         Like [insert][google.spanner.v1.Mutation.insert], except that if the row already exists, it is
         deleted, and the column values provided are inserted
         instead. Unlike [insert_or_update][google.spanner.v1.Mutation.insert_or_update], this means any values not
         explicitly written become `NULL`.
        
         In an interleaved table, if you create the child table with the
         `ON DELETE CASCADE` annotation, then replacing a parent row
         also deletes the child rows. Otherwise, you must delete the
         child rows before you replace the parent row.
         
        .google.spanner.v1.Mutation.Write replace = 4;
        Specified by:
        getReplaceOrBuilder in interface MutationOrBuilder
      • hasDelete

        public boolean hasDelete()
         Delete rows from a table. Succeeds whether or not the named
         rows were present.
         
        .google.spanner.v1.Mutation.Delete delete = 5;
        Specified by:
        hasDelete in interface MutationOrBuilder
        Returns:
        Whether the delete field is set.
      • getDelete

        public Mutation.Delete getDelete()
         Delete rows from a table. Succeeds whether or not the named
         rows were present.
         
        .google.spanner.v1.Mutation.Delete delete = 5;
        Specified by:
        getDelete in interface MutationOrBuilder
        Returns:
        The delete.
      • setDelete

        public Mutation.Builder setDelete​(Mutation.Delete value)
         Delete rows from a table. Succeeds whether or not the named
         rows were present.
         
        .google.spanner.v1.Mutation.Delete delete = 5;
      • setDelete

        public Mutation.Builder setDelete​(Mutation.Delete.Builder builderForValue)
         Delete rows from a table. Succeeds whether or not the named
         rows were present.
         
        .google.spanner.v1.Mutation.Delete delete = 5;
      • mergeDelete

        public Mutation.Builder mergeDelete​(Mutation.Delete value)
         Delete rows from a table. Succeeds whether or not the named
         rows were present.
         
        .google.spanner.v1.Mutation.Delete delete = 5;
      • clearDelete

        public Mutation.Builder clearDelete()
         Delete rows from a table. Succeeds whether or not the named
         rows were present.
         
        .google.spanner.v1.Mutation.Delete delete = 5;
      • getDeleteBuilder

        public Mutation.Delete.Builder getDeleteBuilder()
         Delete rows from a table. Succeeds whether or not the named
         rows were present.
         
        .google.spanner.v1.Mutation.Delete delete = 5;
      • setUnknownFields

        public final Mutation.Builder setUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        setUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        setUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Mutation.Builder>
      • mergeUnknownFields

        public final Mutation.Builder mergeUnknownFields​(com.google.protobuf.UnknownFieldSet unknownFields)
        Specified by:
        mergeUnknownFields in interface com.google.protobuf.Message.Builder
        Overrides:
        mergeUnknownFields in class com.google.protobuf.GeneratedMessageV3.Builder<Mutation.Builder>