@Override public String getKeyType() { return cacheConfig.getKeyType().getName(); }
@Override public String getKeyType() { return cacheConfig.getKeyType().getName(); }
/** * Validates that the configured key matches the provided key. * * @param cacheConfig Cache configuration. * @param key the key to be validated with its type. * @param <K> the type of key. * @throws ClassCastException if the provided key does not match with configured type. */ public static <K> void validateConfiguredTypes(CacheConfig cacheConfig, K key) throws ClassCastException { Class keyType = cacheConfig.getKeyType(); validateConfiguredKeyType(keyType, key); }
/** * Validates that the configured key matches the provided key. * * @param cacheConfig Cache configuration. * @param key the key to be validated with its type. * @param <K> the type of key. * @throws ClassCastException if the provided key does not match with configured type. */ public static <K> void validateConfiguredTypes(CacheConfig cacheConfig, K key) throws ClassCastException { Class keyType = cacheConfig.getKeyType(); validateConfiguredKeyType(keyType, key); }
protected void writeKeyValueTypes(ObjectDataOutput out) throws IOException { out.writeObject(getKeyType()); out.writeObject(getValueType()); }
protected void writeKeyValueTypes(ObjectDataOutput out) throws IOException { out.writeObject(getKeyType()); out.writeObject(getValueType()); }
/** * Validates the configured key and value types matches the provided key, value types. * * @param cacheConfig Cache configuration. * @param key the key to be validated. * @param <K> the type of key. * @param value the value to be validated. * @param <V> the type of value. * @throws ClassCastException if the provided key or value do not match with configured types. */ public static <K, V> void validateConfiguredTypes(CacheConfig cacheConfig, K key, V value) throws ClassCastException { Class keyType = cacheConfig.getKeyType(); Class valueType = cacheConfig.getValueType(); validateConfiguredKeyType(keyType, key); validateConfiguredValueType(valueType, value); }
/** * Validates the configured key and value types matches the provided key, value types. * * @param cacheConfig Cache configuration. * @param key the key to be validated. * @param <K> the type of key. * @param value the value to be validated. * @param <V> the type of value. * @throws ClassCastException if the provided key or value do not match with configured types. */ public static <K, V> void validateConfiguredTypes(CacheConfig cacheConfig, K key, V value) throws ClassCastException { Class keyType = cacheConfig.getKeyType(); Class valueType = cacheConfig.getValueType(); validateConfiguredKeyType(keyType, key); validateConfiguredValueType(valueType, value); }
CacheConfig cacheConfig = cache.getConfiguration(CacheConfig.class); System.out.println("key type: " + cacheConfig.getKeyType()); System.out.println("value type: " + cacheConfig.getValueType());
/** * Validates the configured key and value types matches the provided key, value types. * * @param cacheConfig Cache configuration. * @param key the key to be validated. * @param value1 value to be validated. * @param value2 value to be validated. * @param <K> the type of key. * @param <V> the type of value. * @throws 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 { Class keyType = cacheConfig.getKeyType(); Class valueType = cacheConfig.getValueType(); validateConfiguredKeyType(keyType, key); validateConfiguredValueType(valueType, value1); validateConfiguredValueType(valueType, value2); }
/** * Validates the configured key and value types matches the provided key, value types. * * @param cacheConfig Cache configuration. * @param key the key to be validated. * @param value1 value to be validated. * @param value2 value to be validated. * @param <K> the type of key. * @param <V> the type of value. * @throws 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 { Class keyType = cacheConfig.getKeyType(); Class valueType = cacheConfig.getValueType(); validateConfiguredKeyType(keyType, key); validateConfiguredValueType(valueType, value1); validateConfiguredValueType(valueType, value2); }
out.writeObject(config.getKeyType()); out.writeObject(config.getValueType()); out.writeObject(config.getCacheLoaderFactory());
out.writeObject(config.getKeyType()); out.writeObject(config.getValueType()); out.writeObject(config.getCacheLoaderFactory());
target.setInMemoryFormat(getInMemoryFormat()); if (resolved) { target.setKeyType(getKeyType()); target.setValueType(getValueType()); } else {
target.setInMemoryFormat(getInMemoryFormat()); if (resolved) { target.setKeyType(getKeyType()); target.setValueType(getValueType()); } else {