public class TypeCache<T>
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
TypeCache.Implementation |
| Constructor and Description |
|---|
TypeCache(TypeCache.Implementation typeCacheImplementation) |
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears complete cache.
|
boolean |
containsKey(java.lang.Class type)
Returns
true if the key is contained in the cache. |
static <A> TypeCache<A> |
create(TypeCache.Implementation implementation) |
static <A> TypeCache<A> |
createDefault()
Creates default type cache implementation, as defined in
JoddCoreDefaults. |
T |
get(java.lang.Class<?> key)
Returns value from the map or
null if value does not exist. |
T |
getOrDefault(java.lang.Class<?> key,
T defaultValue)
Returns existing value of default one if key is not registered.
|
boolean |
isEmpty()
Returns
true if cache is empty. |
T |
put(java.lang.Class<?> key,
T value)
Cache some value for given class.
|
T |
remove(java.lang.Class<?> type)
Removes element from type cache.
|
int |
size()
Returns cache size.
|
java.util.Collection<T> |
values()
Returns collection of map values.
|
public TypeCache(TypeCache.Implementation typeCacheImplementation)
public static <A> TypeCache<A> createDefault()
JoddCoreDefaults.public static <A> TypeCache<A> create(TypeCache.Implementation implementation)
public T get(java.lang.Class<?> key)
null if value does not exist.public T getOrDefault(java.lang.Class<?> key, T defaultValue)
public T remove(java.lang.Class<?> type)
public void clear()
public int size()
public boolean isEmpty()
true if cache is empty.public java.util.Collection<T> values()
public boolean containsKey(java.lang.Class type)
true if the key is contained in the cache.Copyright © 2003-present Jodd Team