Class CompareCondition
java.lang.Object
org.springframework.data.redis.connection.CompareCondition
Comparison-based condition for conditional Redis operations such as
DELEX and SET.
CompareCondition objects specify how to compare the existing value with an expected value, supporting both
direct value comparison and digest-based comparison for efficient verification of large values.- Since:
- 4.1
- Author:
- Yordan Tsintsov, Mark Paluch
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumComparison type forDELEXandSETcommand.static enumPredicate types.static interfaceValue abstraction to capture a value or digest preserving its internal representation. -
Method Summary
Modifier and TypeMethodDescriptiongetValue()static CompareConditionifDigestEquals(String hex16Digest) Create a newCompareConditionfordigestcomparison matching if the key value equals the givenhex16Digest.static CompareConditionifDigestNotEquals(String hex16Digest) Create a newCompareConditionfordigestcomparison matching if the key value does not equal the givenhex16Digest.static CompareConditionifEquals(byte[] value) Create a newCompareConditionfor value comparison matching if the key value equals the givenvalue.static CompareConditionifNotEquals(byte[] value) Create a newCompareConditionfor value comparison matching if the key value does not equal the givenvalue.
-
Method Details
-
ifEquals
Create a newCompareConditionfor value comparison matching if the key value equals the givenvalue.- Parameters:
value- the comparison value.- Returns:
- the new
CompareCondition.
-
ifNotEquals
Create a newCompareConditionfor value comparison matching if the key value does not equal the givenvalue.- Parameters:
value- the comparison value.- Returns:
- the new
CompareCondition.
-
ifDigestEquals
Create a newCompareConditionfordigestcomparison matching if the key value equals the givenhex16Digest.- Parameters:
hex16Digest- the value digest in hexadecimal format. Obtained via RedisDIGESTcommand.- Returns:
- the new
CompareCondition. - See Also:
-
ifDigestNotEquals
Create a newCompareConditionfordigestcomparison matching if the key value does not equal the givenhex16Digest.- Parameters:
hex16Digest- the value digest in hexadecimal format. Obtained via RedisDIGESTcommand.- Returns:
- the new
CompareCondition. - See Also:
-
getComparison
-
getOperator
-
getValue
-