Package glide.api.models
Class ClusterValue<T>
- java.lang.Object
-
- glide.api.models.ClusterValue<T>
-
- Type Parameters:
T- The wrapped response type
public class ClusterValue<T> extends java.lang.ObjectRepresents a returned value object from a the server with cluster-mode enabled. The response type may depend on the submittedRequestRoutingConfiguration.Route.- See Also:
- Valkey cluster specification
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.Map<java.lang.String,T>getMultiValue()Get per-node value.
Asserts ifhasMultiData()is false.TgetSingleValue()Get the single value.
Asserts ifhasSingleData()is false.booleanhasMultiData()Check that multi-value is stored in this object.booleanhasSingleData()Check that single-value is stored in this object.static <T> ClusterValue<T>of(java.lang.Object data)A constructor for the value with type auto-detection.static <T> ClusterValue<T>ofMultiValue(java.util.Map<java.lang.String,T> data)A constructor for the value.static <T> ClusterValue<T>ofMultiValueBinary(java.util.Map<GlideString,T> data)A constructor for the value.static <T> ClusterValue<T>ofSingleValue(T data)A constructor for the value.
-
-
-
Method Detail
-
getMultiValue
public java.util.Map<java.lang.String,T> getMultiValue()
Get per-node value.
Asserts ifhasMultiData()is false.
-
getSingleValue
public T getSingleValue()
Get the single value.
Asserts ifhasSingleData()is false.
-
of
public static <T> ClusterValue<T> of(java.lang.Object data)
A constructor for the value with type auto-detection.
-
ofSingleValue
public static <T> ClusterValue<T> ofSingleValue(T data)
A constructor for the value.
-
ofMultiValue
public static <T> ClusterValue<T> ofMultiValue(java.util.Map<java.lang.String,T> data)
A constructor for the value.
-
ofMultiValueBinary
public static <T> ClusterValue<T> ofMultiValueBinary(java.util.Map<GlideString,T> data)
A constructor for the value.
-
hasMultiData
public boolean hasMultiData()
Check that multi-value is stored in this object. Should be called prior togetMultiValue().
-
hasSingleData
public boolean hasSingleData()
Check that single-value is stored in this object. Should be called prior togetSingleValue().
-
-