public final class ImmutableDataCachingUtil extends Object
Modifier and Type | Field and Description |
---|---|
static int |
CACHE_LIMIT_FOR_INDIVIDUAL_TYPE |
static int |
MANIPULATOR_CACHE_LIMIT |
static int |
VALUE_CACHE_LIMIT |
Modifier and Type | Method and Description |
---|---|
static <T extends org.spongepowered.api.data.manipulator.ImmutableDataManipulator<?,?>> |
getManipulator(Class<T> immutableClass,
Object... args)
Retrieves a basic manipulator from
Cache . |
static <E,V extends org.spongepowered.api.data.value.immutable.ImmutableValue<?>,T extends org.spongepowered.api.data.value.immutable.ImmutableValue<E>> |
getValue(Class<V> valueClass,
org.spongepowered.api.data.key.Key<? extends org.spongepowered.api.data.value.BaseValue<E>> usedKey,
E arg,
E defaultArg,
Object... extraArgs) |
public static final int CACHE_LIMIT_FOR_INDIVIDUAL_TYPE
public static final int MANIPULATOR_CACHE_LIMIT
public static final int VALUE_CACHE_LIMIT
public static <T extends org.spongepowered.api.data.manipulator.ImmutableDataManipulator<?,?>> T getManipulator(Class<T> immutableClass, Object... args)
Cache
. If the Cache
does not have the desired ImmutableDataManipulator
with relative
values, a new one is created and submitted to the cache for future
retrieval.
Note that two instances of an ImmutableDataManipulator
may be
equal to each other, but they may not be the same instance, this is due
to caching and outside instantiation.
T
- The type of immutable data manipulatorimmutableClass
- The immutable manipulator class to get an instance ofargs
- The arguments to pass to the constructorpublic static <E,V extends org.spongepowered.api.data.value.immutable.ImmutableValue<?>,T extends org.spongepowered.api.data.value.immutable.ImmutableValue<E>> T getValue(Class<V> valueClass, org.spongepowered.api.data.key.Key<? extends org.spongepowered.api.data.value.BaseValue<E>> usedKey, E arg, E defaultArg, Object... extraArgs)