Class ExpectedRevision


  • public abstract class ExpectedRevision
    extends java.lang.Object
    Constants used for expected revision control.

    The EventStoreDB server will assure idempotency for all requests using any value in ExpectedRevision except ANY. When using ANY, the EventStoreDB server will do its best to assure idempotency but will not guarantee it. Any other ExpectedRevision instances are meant for optimistic concurrency checks.

    • Method Detail

      • any

        public static ExpectedRevision any()
        This writes should not conflict with anything and should always succeed.
      • noStream

        public static ExpectedRevision noStream()
        The stream being written to should not yet exist. If it does exist, treats that as a concurrency problem.
      • streamExists

        public static ExpectedRevision streamExists()
        The stream should exist. If it or a metadata stream does not exist, treats that as a concurrency problem.
      • expectedRevision

        public static ExpectedRevision expectedRevision​(long revision)
        States that the last event written to the stream should have an event revision matching your expected value.
      • equals

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

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