Package com.eventstore.dbclient
Class ExpectedRevision
- java.lang.Object
-
- com.eventstore.dbclient.ExpectedRevision
-
- Direct Known Subclasses:
ExpectedRevision.AnyExpectedRevision
,ExpectedRevision.NoStreamExpectedRevision
,ExpectedRevision.SpecificExpectedRevision
,ExpectedRevision.StreamExistsExpectedRevision
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.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ExpectedRevision.AnyExpectedRevision
static class
ExpectedRevision.NoStreamExpectedRevision
static class
ExpectedRevision.SpecificExpectedRevision
static class
ExpectedRevision.StreamExistsExpectedRevision
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ExpectedRevision
any()
This writes should not conflict with anything and should always succeed.boolean
equals(java.lang.Object o)
static ExpectedRevision
expectedRevision(long revision)
States that the last event written to the stream should have an event revision matching your expected value.static ExpectedRevision
fromRawLong(long revision)
int
hashCode()
static ExpectedRevision
noStream()
The stream being written to should not yet exist.static ExpectedRevision
streamExists()
The stream should exist.long
toRawLong()
-
-
-
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.
-
fromRawLong
public static ExpectedRevision fromRawLong(long revision)
-
toRawLong
public long toRawLong()
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
-