Class NoOpCache

java.lang.Object
org.miaixz.bus.cache.metric.NoOpCache
All Implemented Interfaces:
CacheX

public class NoOpCache extends Object implements CacheX
无缓存实现,用于快速关闭缓存
Since:
Java 17+
Author:
Kimi Liu
  • Constructor Details

    • NoOpCache

      public NoOpCache()
  • Method Details

    • read

      public Object read(String key)
      Description copied from interface: CacheX
      从缓存中获得对象
      Specified by:
      read in interface CacheX
      Parameters:
      key - 键
      Returns:
      键对应的对象
      See Also:
    • write

      public void write(String key, Object value, long expire)
      Description copied from interface: CacheX
      将对象加入到缓存,使用指定失效时长
      Specified by:
      write in interface CacheX
      Parameters:
      key - 键
      value - 缓存的对象
      expire - 失效时长,单位毫秒
      See Also:
    • read

      public Map<String,Object> read(Collection<String> keys)
      Description copied from interface: CacheX
      从缓存中获得一组对象信息
      Specified by:
      read in interface CacheX
      Parameters:
      keys - 多个键
      Returns:
      值对象
    • write

      public void write(Map<String,Object> keyValueMap, long expire)
      Description copied from interface: CacheX
      将对象加入到缓存,使用指定失效时长
      Specified by:
      write in interface CacheX
      Parameters:
      keyValueMap - 缓存的对象
      expire - 失效时长,单位毫秒
      See Also:
    • remove

      public void remove(String... keys)
      Description copied from interface: CacheX
      从缓存中移除对象
      Specified by:
      remove in interface CacheX
      Parameters:
      keys - 键
    • clear

      public void clear()
      Description copied from interface: CacheX
      清空缓存信息
      Specified by:
      clear in interface CacheX