Class InjectedSetValue<T>

  • Type Parameters:
    T - the value type
    All Implemented Interfaces:
    Value<java.util.Set<T>>

    public final class InjectedSetValue<T>
    extends java.lang.Object
    implements Value<java.util.Set<T>>
    A Set value that can have entries injected into it. The underlying set is an instance of LinkedHashSet, so iteration order will be consistent.

    The injector() method is used to get an injector that can inject into the set.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.Set<T> cachedValue  
      private java.util.Set<T> value  
    • Constructor Summary

      Constructors 
      Constructor Description
      InjectedSetValue()
      Construct a new instance.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private void addItem​(T item)  
      java.util.Set<T> getValue()
      Get the actual value.
      Injector<T> injector()
      Gets an injector for this set.
      private void removeItem​(T item)  
      • Methods inherited from class java.lang.Object

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

      • value

        private final java.util.Set<T> value
      • cachedValue

        private volatile java.util.Set<T> cachedValue
    • Constructor Detail

      • InjectedSetValue

        public InjectedSetValue()
        Construct a new instance.
    • Method Detail

      • getValue

        public java.util.Set<T> getValue()
                                  throws java.lang.IllegalStateException
        Get the actual value.
        Specified by:
        getValue in interface Value<T>
        Returns:
        the actual value
        Throws:
        java.lang.IllegalStateException - if the value is time-sensitive and the current state does not allow retrieval.
      • addItem

        private void addItem​(T item)
      • removeItem

        private void removeItem​(T item)
      • injector

        public Injector<T> injector()
        Gets an injector for this set.
        Returns:
        An Injector that can inject into the value set.