Class Cache.Reference<K,​V>

  • All Implemented Interfaces:
    java.util.function.Supplier<V>, org.comroid.api.SelfDeclared<org.comroid.mutatio.ref.Reference<V>>, org.comroid.api.Specifiable<org.comroid.mutatio.ref.Reference<V>>, org.comroid.mutatio.ref.Reference<V>, org.comroid.mutatio.ref.Reference.Settable<V>
    Enclosing interface:
    Cache<K,​V>

    public static class Cache.Reference<K,​V>
    extends java.lang.Object
    implements org.comroid.mutatio.ref.Reference.Settable<V>
    • Nested Class Summary

      • Nested classes/interfaces inherited from interface org.comroid.mutatio.ref.Reference

        org.comroid.mutatio.ref.Reference.Settable<T extends java.lang.Object>, org.comroid.mutatio.ref.Reference.Support
    • Field Summary

      Fields 
      Modifier and Type Field Description
      java.util.concurrent.atomic.AtomicReference<V> reference  
    • Constructor Summary

      Constructors 
      Constructor Description
      Reference​(K key)  
      Reference​(K key, V initValue)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static <K,​V>
      Cache.Reference<K,​V>
      constant​(K key, V value)  
      static <K,​V>
      Cache.Reference<K,​V>
      create()  
      V get()  
      K getKey()  
      org.comroid.api.Provider<V> provider()  
      V set​(V value)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface org.comroid.mutatio.ref.Reference

        into, invocable, isNull, orElse, orElseGet, process, requireNonNull, requireNonNull, stream, test, wrap
      • Methods inherited from interface org.comroid.mutatio.ref.Reference.Settable

        compute, computeIfAbsent, computeIfPresent
      • Methods inherited from interface org.comroid.api.SelfDeclared

        self
      • Methods inherited from interface org.comroid.api.Specifiable

        as, as, isType
    • Field Detail

      • reference

        public final java.util.concurrent.atomic.AtomicReference<V> reference
    • Constructor Detail

      • Reference

        public Reference​(K key)
      • Reference

        public Reference​(K key,
                         V initValue)
    • Method Detail

      • getKey

        @NotNull
        public K getKey()
      • constant

        public static <K,​V> Cache.Reference<K,​V> constant​(K key,
                                                                      V value)
      • set

        @Nullable
        public V set​(V value)
        Specified by:
        set in interface org.comroid.mutatio.ref.Reference.Settable<K>
      • get

        @Nullable
        public V get()
        Specified by:
        get in interface org.comroid.mutatio.ref.Reference<K>
        Specified by:
        get in interface java.util.function.Supplier<K>
      • provider

        public org.comroid.api.Provider<V> provider()
        Specified by:
        provider in interface org.comroid.mutatio.ref.Reference<K>