public enum VersionType extends Enum<VersionType>
Enum Constant and Description |
---|
EXTERNAL |
EXTERNAL_GTE |
FORCE
Warning: this version type should be used with care.
|
INTERNAL |
Modifier and Type | Method and Description |
---|---|
static VersionType |
fromString(String versionType) |
static VersionType |
fromString(String versionType,
VersionType defaultVersionType) |
static VersionType |
fromValue(byte value) |
byte |
getValue() |
abstract boolean |
isVersionConflictForReads(long currentVersion,
long expectedVersion)
Checks whether the current version conflicts with the expected version, based on the current version type.
|
abstract boolean |
isVersionConflictForWrites(long currentVersion,
long expectedVersion)
Checks whether the current version conflicts with the expected version, based on the current version type.
|
abstract long |
updateVersion(long currentVersion,
long expectedVersion)
Returns the new version for a document, based on its current one and the specified in the request
|
abstract boolean |
validateVersionForReads(long version)
validate the version is a valid value for this type when reading.
|
abstract boolean |
validateVersionForWrites(long version)
validate the version is a valid value for this type when writing.
|
static VersionType |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static VersionType[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
VersionType |
versionTypeForReplicationAndRecovery()
Some version types require different semantics for primary and replicas.
|
public static final VersionType INTERNAL
public static final VersionType EXTERNAL
public static final VersionType EXTERNAL_GTE
public static final VersionType FORCE
public static VersionType[] values()
for (VersionType c : VersionType.values()) System.out.println(c);
public static VersionType valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic byte getValue()
public abstract boolean isVersionConflictForWrites(long currentVersion, long expectedVersion)
public abstract boolean isVersionConflictForReads(long currentVersion, long expectedVersion)
public abstract long updateVersion(long currentVersion, long expectedVersion)
public abstract boolean validateVersionForWrites(long version)
public abstract boolean validateVersionForReads(long version)
public VersionType versionTypeForReplicationAndRecovery()
public static VersionType fromString(String versionType)
public static VersionType fromString(String versionType, VersionType defaultVersionType)
public static VersionType fromValue(byte value)
Copyright © 2009–2016. All rights reserved.