Class ConcurrentMapInjector<K,​T>

  • Type Parameters:
    K - the key type
    T - the value type
    All Implemented Interfaces:
    Injector<T>

    public final class ConcurrentMapInjector<K,​T>
    extends RetainingInjector<T>
    implements Injector<T>
    An injector which applies a value to a concurrent map entry.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private K key  
      private java.util.concurrent.ConcurrentMap<K,​T> map  
    • Constructor Summary

      Constructors 
      Constructor Description
      ConcurrentMapInjector​(java.util.concurrent.ConcurrentMap<K,​T> map, K key)
      Construct a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void inject​(T value)
      Inject the given value.
      void uninject()
      Uninject the given value (in other words, cancel or undo a previous injection).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • map

        private final java.util.concurrent.ConcurrentMap<K,​T> map
      • key

        private final K key
    • Constructor Detail

      • ConcurrentMapInjector

        public ConcurrentMapInjector​(java.util.concurrent.ConcurrentMap<K,​T> map,
                                     K key)
        Construct a new instance.
        Parameters:
        map - the map to update
        key - the key for this injector