程序包 tech.riemann.etp

类 CacheMap<K,V>

java.lang.Object
java.util.AbstractMap<K,V>
tech.riemann.etp.CacheMap<K,V>
类型参数:
K -
V -
所有已实现的接口:
Map<K,V>

public class CacheMap<K,V> extends AbstractMap<K,V>
作者:
Kerbores(kerbores@riemann.tech)
  • 构造器详细资料

    • CacheMap

      public CacheMap(long timeout)
  • 方法详细资料

    • getDefault

      public static CacheMap<Object,Object> getDefault()
    • entrySet

      public Set<Map.Entry<K,V>> entrySet()
      指定者:
      entrySet 在接口中 Map<K,V>
      指定者:
      entrySet 在类中 AbstractMap<K,V>
    • get

      public V get(Object key)
      根据给定的键从缓存中获取值
      指定者:
      get 在接口中 Map<K,V>
      覆盖:
      get 在类中 AbstractMap<K,V>
      参数:
      key - 要获取值的键
      返回:
      与指定键关联的值如果键不存在,则返回null
    • put

      public V put(K key, V value)
      向缓存中添加一个键值对。
      指定者:
      put 在接口中 Map<K,V>
      覆盖:
      put 在类中 AbstractMap<K,V>
      参数:
      key - 缓存键,用于标识缓存中的项。
      value - 缓存值,要添加到缓存中的数据。
      返回:
      返回被替换的旧值,如果之前不存在则返回null。
    • equals

      public boolean equals(Object o)
      指定者:
      equals 在接口中 Map<K,V>
      覆盖:
      equals 在类中 AbstractMap<K,V>
    • hashCode

      public int hashCode()
      指定者:
      hashCode 在接口中 Map<K,V>
      覆盖:
      hashCode 在类中 AbstractMap<K,V>