Class ExpirableSet<K>

java.lang.Object
org.kingdoms.utils.internal.ExpirableSet<K>

public class ExpirableSet<K> extends Object
  • Constructor Details

    • ExpirableSet

      public ExpirableSet(long duration, TimeUnit unit, boolean expireAfterAccess)
      Parameters:
      expireAfterAccess - true if it should expire after access or false if it should expire after write.
  • Method Details

    • add

      public boolean add(K key)
    • get

      public long get(K key)
    • getTimeLeft

      public long getTimeLeft(K key)
    • clear

      public void clear()
    • contains

      public boolean contains(K key)
    • remove

      public void remove(K key)