T - the typepublic interface CooldownMap<T>
| Modifier and Type | Method and Description |
|---|---|
static <T> CooldownMap<T> |
create(Cooldown base)
Creates a new collection with the cooldown properties defined by the base instance
|
default long |
elapsed(T key) |
Cooldown |
get(T key)
Gets the internal cooldown instance associated with the given key.
|
Map<T,Cooldown> |
getAll()
Gets the cooldowns contained within this collection.
|
Cooldown |
getBase()
Gets the base cooldown
|
default OptionalLong |
getLastTested(T key) |
void |
put(T key,
Cooldown cooldown) |
default long |
remainingMillis(T key) |
default long |
remainingTime(T key,
TimeUnit unit) |
default void |
reset(T key) |
default void |
setLastTested(T key,
long time) |
default boolean |
test(T key) |
default boolean |
testSilently(T key) |
@Nonnull static <T> CooldownMap<T> create(@Nonnull Cooldown base)
base - the cooldown to base off@Nonnull Cooldown get(@Nonnull T key)
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.
key - the key@Nonnull Map<T,Cooldown> getAll()
@Nonnull default OptionalLong getLastTested(@Nonnull T key)
Copyright © 2022. All rights reserved.