public final class CacheProxyUtil extends Object
CacheProxy
Modifier and Type | Field and Description |
---|---|
static int |
AWAIT_COMPLETION_TIMEOUT_SECONDS |
Modifier and Type | Method and Description |
---|---|
static int |
getPartitionId(NodeEngine nodeEngine,
Data key) |
static <K> void |
validateConfiguredKeyType(Class<K> keyType,
K key)
Validates the key with key type.
|
static <K> void |
validateConfiguredTypes(CacheConfig cacheConfig,
K key)
Validates that the configured key matches the provided key.
|
static <K,V> void |
validateConfiguredTypes(CacheConfig cacheConfig,
K key,
V value)
Validates the configured key and value types matches the provided key, value types.
|
static <K,V> void |
validateConfiguredTypes(CacheConfig cacheConfig,
K key,
V value1,
V value2)
Validates the configured key and value types matches the provided key, value types.
|
static <V> void |
validateConfiguredValueType(Class<V> valueType,
V value)
Validates the value with value type.
|
static <K> void |
validateNotNull(K key)
Validates that a key is not null.
|
static <K,V> void |
validateNotNull(K key,
V value)
Validates that key, value pair are both not null.
|
static <K,V> void |
validateNotNull(K key,
V value1,
V value2)
Validates that key and multi values are not null.
|
static <K,V> void |
validateNotNull(Map<? extends K,? extends V> map)
This validator ensures that no key or value is null in the provided map.
|
static <K> void |
validateNotNull(Set<? extends K> keys)
Validates that none of the keys are null in set.
|
static void |
validateResults(Map<Integer,Object> results)
Cache clear response validator, loop on results to validate that no exception exists on the result map.
|
public static final int AWAIT_COMPLETION_TIMEOUT_SECONDS
public static void validateResults(Map<Integer,Object> results)
results
- map of CacheClearResponse
.public static int getPartitionId(NodeEngine nodeEngine, Data key)
public static <K> void validateNotNull(K key)
K
- the type of key.key
- the key to be validated.NullPointerException
- if provided key is null.public static <K,V> void validateNotNull(K key, V value)
K
- the type of key.V
- the type of value.key
- the key to be validated.value
- the value to be validated.NullPointerException
- if key or value is null.public static <K,V> void validateNotNull(K key, V value1, V value2)
K
- the type of key.V
- the type of value.key
- the key to be validated.value1
- first value to be validated.value2
- second value to be validated.NullPointerException
- if key or any value is null.public static <K> void validateNotNull(Set<? extends K> keys)
K
- the type of key.keys
- set of keys to be validated.NullPointerException
- if provided key set contains a null key.public static <K,V> void validateNotNull(Map<? extends K,? extends V> map)
K
- the type of key.V
- the type of value.map
- the map to be validated.NullPointerException
- if provided map contains a null key or value in the map.public static <K> void validateConfiguredTypes(CacheConfig cacheConfig, K key) throws ClassCastException
K
- the type of key.cacheConfig
- Cache configuration.key
- the key to be validated with its type.ClassCastException
- if the provided key does not match with configured type.public static <K,V> void validateConfiguredTypes(CacheConfig cacheConfig, K key, V value) throws ClassCastException
K
- the type of key.V
- the type of value.cacheConfig
- Cache configuration.key
- the key to be validated.value
- the value to be validated.ClassCastException
- if the provided key or value do not match with configured types.public static <K,V> void validateConfiguredTypes(CacheConfig cacheConfig, K key, V value1, V value2) throws ClassCastException
K
- the type of key.V
- the type of value.cacheConfig
- Cache configuration.key
- the key to be validated.value1
- value to be validated.value2
- value to be validated.ClassCastException
- if the provided key or value do not match with configured types.public static <K> void validateConfiguredKeyType(Class<K> keyType, K key) throws ClassCastException
K
- the type of key.keyType
- key class.key
- key to be validated.ClassCastException
- if the provided key do not match with keyType.public static <V> void validateConfiguredValueType(Class<V> valueType, V value) throws ClassCastException
V
- the type of value.valueType
- value class.value
- value to be validated.ClassCastException
- if the provided value do not match with valueType.Copyright © 2016 Hazelcast, Inc.. All Rights Reserved.