Class MildValues.StrongEntry

  • All Implemented Interfaces:
    java.util.Map.Entry<K,​V>
    Enclosing class:
    MildValues<K,​V>

    final class MildValues.StrongEntry
    extends java.lang.Object
    implements java.util.Map.Entry<K,​V>
    Map.Entry that delegates to the original entry, but maintains a strong reference to the value.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Map.Entry<K,​java.lang.ref.Reference<V>> entry  
      private V value  
    • Constructor Summary

      Constructors 
      Constructor Description
      StrongEntry​(java.util.Map.Entry<K,​java.lang.ref.Reference<V>> entry, V value)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      K getKey()  
      V getValue()  
      V setValue​(V newValue)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.util.Map.Entry

        equals, hashCode
    • Field Detail

      • entry

        private final java.util.Map.Entry<K,​java.lang.ref.Reference<V>> entry
      • value

        private V value
    • Constructor Detail

      • StrongEntry

        StrongEntry​(java.util.Map.Entry<K,​java.lang.ref.Reference<V>> entry,
                    V value)
    • Method Detail

      • getKey

        public K getKey()
        Specified by:
        getKey in interface java.util.Map.Entry<K,​V>
      • getValue

        public V getValue()
        Specified by:
        getValue in interface java.util.Map.Entry<K,​V>
      • setValue

        public V setValue​(V newValue)
        Specified by:
        setValue in interface java.util.Map.Entry<K,​V>