public enum ValueMatcher extends Enum<ValueMatcher>
putIfAbsent(k, v)
already succeeded on a backup owner which became the primary owner,
when retrying the command will find v
in the cache but should return null
. For non-conditional
commands it's impossible to know what the previous value was, so the command is allowed to return v
.Enum Constant and Description |
---|
MATCH_ALWAYS
Always match.
|
MATCH_EXPECTED
Match when the existing value is equal to the expected value.
|
MATCH_EXPECTED_OR_NEW
Match when the existing value is equal to the expected value or to the new value.
|
MATCH_NEVER
Never match.
|
MATCH_NON_NULL
Match any non-null value.
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
equal(Object a,
Object b,
Equivalence valueEquivalence) |
protected Object |
extractValue(MVCCEntry mvccEntry) |
abstract ValueMatcher |
matcherForRetry() |
abstract boolean |
matches(MVCCEntry existingEntry,
Object expectedValue,
Object newValue,
Equivalence valueEquivalence) |
abstract boolean |
nonExistentEntryCanMatch() |
static ValueMatcher |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ValueMatcher[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ValueMatcher MATCH_ALWAYS
BasicCache.remove(Object)
operations.public static final ValueMatcher MATCH_EXPECTED
ConcurrentMap.putIfAbsent(Object, Object)
, ConcurrentMap.replace(Object, Object, Object)
,
and ConcurrentMap.remove(Object, Object)
.public static final ValueMatcher MATCH_EXPECTED_OR_NEW
public static final ValueMatcher MATCH_NON_NULL
ConcurrentMap.replace(Object, Object)
and BasicCache.remove(Object)
.public static final ValueMatcher MATCH_NEVER
public static ValueMatcher[] values()
for (ValueMatcher c : ValueMatcher.values()) System.out.println(c);
public static ValueMatcher 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 abstract boolean matches(MVCCEntry existingEntry, Object expectedValue, Object newValue, Equivalence valueEquivalence)
public abstract boolean nonExistentEntryCanMatch()
public abstract ValueMatcher matcherForRetry()
protected boolean equal(Object a, Object b, Equivalence valueEquivalence)
Copyright © 2014 JBoss, a division of Red Hat. All Rights Reserved.