Class EmptyCache<K,V>

java.lang.Object
io.github.xanthic.cache.core.delegate.EmptyCache<K,V>
All Implemented Interfaces:
io.github.xanthic.cache.api.Cache<K,V>

public final class EmptyCache<K,V> extends Object implements io.github.xanthic.cache.api.Cache<K,V>
  • Method Details

    • get

      @Internal public static <K, V> io.github.xanthic.cache.api.Cache<K,V> get()
    • get

      @Nullable public V get(@NotNull K key)
      Specified by:
      get in interface io.github.xanthic.cache.api.Cache<K,V>
    • put

      @Nullable public V put(@NotNull K key, @NotNull V value)
      Specified by:
      put in interface io.github.xanthic.cache.api.Cache<K,V>
    • remove

      @Nullable public V remove(@NotNull K key)
      Specified by:
      remove in interface io.github.xanthic.cache.api.Cache<K,V>
    • clear

      public void clear()
      Specified by:
      clear in interface io.github.xanthic.cache.api.Cache<K,V>
    • size

      public long size()
      Specified by:
      size in interface io.github.xanthic.cache.api.Cache<K,V>
    • compute

      @Nullable public V compute(@NotNull K key, @NotNull @NotNull BiFunction<? super K,? super V,? extends V> computeFunc)
      Specified by:
      compute in interface io.github.xanthic.cache.api.Cache<K,V>
    • computeIfAbsent

      public V computeIfAbsent(@NotNull K key, @NotNull @NotNull Function<K,V> computeFunc)
      Specified by:
      computeIfAbsent in interface io.github.xanthic.cache.api.Cache<K,V>
    • computeIfPresent

      @Nullable public V computeIfPresent(@NotNull K key, @NotNull @NotNull BiFunction<? super K,? super V,? extends V> computeFunc)
      Specified by:
      computeIfPresent in interface io.github.xanthic.cache.api.Cache<K,V>
    • putIfAbsent

      @Nullable public V putIfAbsent(@NotNull K key, @NotNull V value)
      Specified by:
      putIfAbsent in interface io.github.xanthic.cache.api.Cache<K,V>
    • merge

      public V merge(@NotNull K key, @NotNull V value, @NotNull @NotNull BiFunction<V,V,V> mergeFunc)
      Specified by:
      merge in interface io.github.xanthic.cache.api.Cache<K,V>
    • replace

      public boolean replace(@NotNull K key, @NotNull V value)
      Specified by:
      replace in interface io.github.xanthic.cache.api.Cache<K,V>
    • replace

      public boolean replace(@NotNull K key, @NotNull V oldValue, @NotNull V newValue)
      Specified by:
      replace in interface io.github.xanthic.cache.api.Cache<K,V>
    • getOrDefault

      @NotNull public V getOrDefault(@NotNull K key, @NotNull V defaultValue)
      Specified by:
      getOrDefault in interface io.github.xanthic.cache.api.Cache<K,V>
    • putAll

      public void putAll(@NotNull @NotNull Map<? extends K,? extends V> map)
      Specified by:
      putAll in interface io.github.xanthic.cache.api.Cache<K,V>
    • forEach

      public void forEach(@NotNull @NotNull BiConsumer<? super K,? super V> action)
      Specified by:
      forEach in interface io.github.xanthic.cache.api.Cache<K,V>