Class Precondition

java.lang.Object
com.google.cloud.firestore.Precondition

public final class Precondition extends Object
Preconditions that can be used to restrict update() calls.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final Precondition
    An empty Precondition that adds no enforcements
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns true if this Precondition is equal to the provided object.
    int
     
    updatedAt(com.google.cloud.Timestamp updateTime)
    Creates a Precondition that enforces that the existing document was written at the specified time.

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • NONE

      public static final Precondition NONE
      An empty Precondition that adds no enforcements
  • Method Details

    • updatedAt

      @Nonnull public static Precondition updatedAt(com.google.cloud.Timestamp updateTime)
      Creates a Precondition that enforces that the existing document was written at the specified time.
      Parameters:
      updateTime - The write time to enforce on the existing document.
      Returns:
      A new Precondition
    • equals

      public boolean equals(Object obj)
      Returns true if this Precondition is equal to the provided object.
      Overrides:
      equals in class Object
      Parameters:
      obj - The object to compare against.
      Returns:
      Whether this Precondition is equal to the provided object.
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object