Class MutationGroup

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Iterable<com.google.cloud.spanner.Mutation>

    public final class MutationGroup
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Iterable<com.google.cloud.spanner.Mutation>
    A bundle of mutations that must be submitted atomically.

    One of the mutations is chosen to be "primary", and can be used to determine partitions.

    See Also:
    Serialized Form
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.util.List<com.google.cloud.spanner.Mutation> attached()  
      static MutationGroup create​(com.google.cloud.spanner.Mutation primary, com.google.cloud.spanner.Mutation... other)
      Creates a new group.
      static MutationGroup create​(com.google.cloud.spanner.Mutation primary, java.lang.Iterable<com.google.cloud.spanner.Mutation> other)  
      boolean equals​(@Nullable java.lang.Object o)  
      int hashCode()  
      java.util.Iterator<com.google.cloud.spanner.Mutation> iterator()  
      com.google.cloud.spanner.Mutation primary()  
      long size()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Method Detail

      • create

        public static MutationGroup create​(com.google.cloud.spanner.Mutation primary,
                                           com.google.cloud.spanner.Mutation... other)
        Creates a new group.
        Parameters:
        primary - a primary mutation.
        other - other mutations, usually interleaved in parent.
        Returns:
        new mutation group.
      • create

        public static MutationGroup create​(com.google.cloud.spanner.Mutation primary,
                                           java.lang.Iterable<com.google.cloud.spanner.Mutation> other)
      • iterator

        public java.util.Iterator<com.google.cloud.spanner.Mutation> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<com.google.cloud.spanner.Mutation>
      • size

        public long size()
      • primary

        public com.google.cloud.spanner.Mutation primary()
      • attached

        public java.util.List<com.google.cloud.spanner.Mutation> attached()
      • equals

        public boolean equals​(@Nullable java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object