Class AbstractCache<K,V>

java.lang.Object
com.landawn.abacus.cache.AbstractCache<K,V>
Type Parameters:
K - the key type
V - the value type
All Implemented Interfaces:
Cache<K,V>, Closeable, AutoCloseable
Direct Known Subclasses:
CaffeineCache, DistributedCache, Ehcache, LocalCache, OffHeapCache

public abstract class AbstractCache<K,V> extends Object implements Cache<K,V>
Since:
0.8
Author:
Haiyang Li
  • Method Details

    • get

      public com.landawn.abacus.util.u.Optional<V> get(K k)
      Specified by:
      get in interface Cache<K,V>
      Parameters:
      k -
      Returns:
    • put

      public boolean put(K key, V value)
      Specified by:
      put in interface Cache<K,V>
      Parameters:
      key -
      value -
      Returns:
      true, if successful
    • asyncGet

      public com.landawn.abacus.util.ContinuableFuture<com.landawn.abacus.util.u.Optional<V>> asyncGet(K k)
      Specified by:
      asyncGet in interface Cache<K,V>
      Parameters:
      k -
      Returns:
    • asyncGett

      public com.landawn.abacus.util.ContinuableFuture<V> asyncGett(K k)
      Specified by:
      asyncGett in interface Cache<K,V>
      Parameters:
      k -
      Returns:
    • asyncPut

      public com.landawn.abacus.util.ContinuableFuture<Boolean> asyncPut(K k, V v)
      Specified by:
      asyncPut in interface Cache<K,V>
      Parameters:
      k -
      v -
      Returns:
    • asyncPut

      public com.landawn.abacus.util.ContinuableFuture<Boolean> asyncPut(K k, V v, long liveTime, long maxIdleTime)
      Specified by:
      asyncPut in interface Cache<K,V>
      Parameters:
      k -
      v -
      liveTime -
      maxIdleTime -
      Returns:
    • asyncRemove

      public com.landawn.abacus.util.ContinuableFuture<Void> asyncRemove(K k)
      Specified by:
      asyncRemove in interface Cache<K,V>
      Parameters:
      k -
      Returns:
    • asyncContainsKey

      public com.landawn.abacus.util.ContinuableFuture<Boolean> asyncContainsKey(K k)
      Async contains key.
      Specified by:
      asyncContainsKey in interface Cache<K,V>
      Parameters:
      k -
      Returns:
    • getProperties

      public com.landawn.abacus.util.Properties<String,Object> getProperties()
      Gets the properties.
      Specified by:
      getProperties in interface Cache<K,V>
      Returns:
    • getProperty

      public <T> T getProperty(String propName)
      Gets the property.
      Specified by:
      getProperty in interface Cache<K,V>
      Type Parameters:
      T -
      Parameters:
      propName -
      Returns:
    • setProperty

      public <T> T setProperty(String propName, Object propValue)
      Sets the property.
      Specified by:
      setProperty in interface Cache<K,V>
      Type Parameters:
      T -
      Parameters:
      propName -
      propValue -
      Returns:
    • removeProperty

      public <T> T removeProperty(String propName)
      Removes the property.
      Specified by:
      removeProperty in interface Cache<K,V>
      Type Parameters:
      T -
      Parameters:
      propName -
      Returns: