Interface SetSpec<K,V>
- Type Parameters:
K- key type.V- value type.
public interface SetSpec<K,V>
Steps for configuring a
SET operation.- Since:
- 4.1
- Author:
- Yordan Tsintsov
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceSteps to customize value or digest comparison for conditional set operations. -
Method Summary
Modifier and TypeMethodDescriptionalways()Set the key unconditionally.expiration(Expiration expiration) Set the key with the given expiration.Set the key to expire after the given duration.ifAbsent()Set the key if it does not exist.ifEquals()Configure to set the value only if the value matches the given value or digest.Configure to set the value only if the value does not match the given value or digest.Set the key if it exists.keepTtl()Retain the existing TTL associated with the key.
-
Method Details
-
always
-
ifAbsent
-
ifPresent
-
ifEquals
SetSpec.ComparisonSpec<K,V> ifEquals()Configure to set the value only if the value matches the given value or digest.- Returns:
- a
SetSpec.ComparisonSpecto specify the value or digest to compare against.
-
ifNotEquals
SetSpec.ComparisonSpec<K,V> ifNotEquals()Configure to set the value only if the value does not match the given value or digest.- Returns:
- a
SetSpec.ComparisonSpecto specify the value or digest to compare against.
-
keepTtl
-
expire
-
expiration
Set the key with the given expiration.- Parameters:
expiration- the expiration to apply.- Returns:
- this builder.
-