Class SelfExpiringHashMap<K,V>
java.lang.Object
me.despical.commandframework.utils.SelfExpiringHashMap<K,V>
- All Implemented Interfaces:
Map<K,,V> SelfExpiringMap<K,V>
- Author:
- Despical
Created at 6.02.2024
-
Nested Class Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()booleancontainsKey(Object key) booleancontainsValue(Object value) entrySet()booleanisEmpty()keySet()Associates the specified value with the specified key in this map.voidintsize()@NotNull Collection<V> values()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
SelfExpiringHashMap
public SelfExpiringHashMap()
-
-
Method Details
-
put
Associates the specified value with the specified key in this map. If the map previously contained a mapping for the key, the old value is replaced.- Specified by:
putin interfaceSelfExpiringMap<K,V> - Parameters:
key- key with which the specified value is to be associatedvalue- value to be associated with the specified keylifeTimeMs- how many milliseconds should the key live- Returns:
- the previous value associated with
key, ornullif there was no mapping forkey. (Anullreturn can also indicate that the map previously associatednullwithkey.)
-
put
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,V>
-
get
-
remove
-
size
public int size() -
isEmpty
public boolean isEmpty() -
containsValue
- Specified by:
containsValuein interfaceMap<K,V>
-
putAll
-
clear
public void clear() -
keySet
-
values
-
entrySet
-