T - the key typeCooldownMap@Deprecated @NonnullByDefault public class CooldownCollection<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected Cooldown |
base
Deprecated.
|
protected LoadingCache<String,Cooldown> |
cache
Deprecated.
|
protected Function<T,String> |
mappingFunc
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
static CooldownCollection<String> |
create(Cooldown base)
Deprecated.
|
static <T> CooldownCollection<T> |
create(Function<T,String> mappingFunc,
Cooldown base)
Deprecated.
|
static <T> CooldownCollection<T> |
createWithToString(Cooldown base)
Deprecated.
|
long |
elapsed(T t)
Deprecated.
|
Cooldown |
get(T t)
Deprecated.
Gets the internal cooldown instance associated with the given key
|
Map<String,Cooldown> |
getAll()
Deprecated.
Gets the cooldowns contained within this collection.
|
void |
load(JsonObject data)
Deprecated.
Loads a JsonObject of keys mapped to the last "test" time into this
collection.
|
long |
remainingMillis(T t)
Deprecated.
|
long |
remainingTime(T t,
TimeUnit unit)
Deprecated.
|
void |
reset(T t)
Deprecated.
|
JsonObject |
save()
Deprecated.
Serializes the contained data into a
JsonObject for saving. |
boolean |
test(T t)
Deprecated.
|
boolean |
testSilently(T t)
Deprecated.
|
protected final Cooldown base
protected final LoadingCache<String,Cooldown> cache
@Deprecated public static CooldownCollection<String> create(Cooldown base)
base - the cooldown to base off@Deprecated public static <T> CooldownCollection<T> create(Function<T,String> mappingFunc, Cooldown base)
T - the key typemappingFunc - the mapping function from the key type to Stringbase - the cooldown to base off@Deprecated public static <T> CooldownCollection<T> createWithToString(Cooldown base)
The mapping from key type to string is defined by the behaviour of Object.toString()
T - the key typebase - the cooldown to base offpublic Cooldown get(T t)
The inline Cooldown methods in this class should be used to access the functionality of the cooldown as opposed to calling the methods directly via the instance returned by this method.
t - the keypublic Map<String,Cooldown> getAll()
public boolean test(T t)
public boolean testSilently(T t)
public long elapsed(T t)
public void reset(T t)
public long remainingMillis(T t)
public void load(JsonObject data)
data - the data to loadpublic JsonObject save()
JsonObject for saving.Copyright © 2017. All rights reserved.