Class SingleValueCache<K,​V>

  • Type Parameters:
    K -
    V -

    public class SingleValueCache<K,​V>
    extends Object
    Minimalistic cache holding only one last set value
    • Constructor Detail

      • SingleValueCache

        public SingleValueCache()
    • Method Detail

      • getIfPresent

        @Nullable
        public V getIfPresent​(@NotNull
                              Object key)
      • get

        public V get​(@NotNull
                     K key,
                     @NotNull
                     Function<K,​? extends V> valueLoader)
      • put

        public void put​(@NotNull
                        K key,
                        @NotNull
                        V value)
      • invalidate

        public void invalidate()
      • isPresent

        public boolean isPresent()