Class ChildIterableImpl<T>

  • All Implemented Interfaces:
    java.lang.Iterable<T>, ChildIterable<T>

    public class ChildIterableImpl<T>
    extends java.lang.Object
    implements ChildIterable<T>
    • Constructor Summary

      Constructors 
      Constructor Description
      ChildIterableImpl​(ServiceLocator locator, java.lang.reflect.Type childType, java.lang.String prefix, java.lang.String separator)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      T byKey​(java.lang.String key)
      Gets the child with the given key.
      java.lang.Iterable<ServiceHandle<T>> handleIterator()
      Returns an iterator of the children's Service Handle, rather than their services
      java.util.Iterator<T> iterator()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface java.lang.Iterable

        forEach, spliterator
    • Field Detail

      • childType

        private final java.lang.reflect.Type childType
      • prefix

        private final java.lang.String prefix
      • separator

        private final java.lang.String separator
    • Constructor Detail

      • ChildIterableImpl

        ChildIterableImpl​(ServiceLocator locator,
                          java.lang.reflect.Type childType,
                          java.lang.String prefix,
                          java.lang.String separator)
    • Method Detail

      • iterator

        public java.util.Iterator<T> iterator()
        Specified by:
        iterator in interface java.lang.Iterable<T>
      • byKey

        public T byKey​(java.lang.String key)
        Description copied from interface: ChildIterable
        Gets the child with the given key. The separator used to determine the full suffix to look for in the child is given by the ChildInject.separator() field
        Specified by:
        byKey in interface ChildIterable<T>
        Parameters:
        key - The non-null key of the child to get
        Returns:
        The child who has the given key
      • handleIterator

        public java.lang.Iterable<ServiceHandle<T>> handleIterator()
        Description copied from interface: ChildIterable
        Returns an iterator of the children's Service Handle, rather than their services
        Specified by:
        handleIterator in interface ChildIterable<T>
        Returns:
        the iterator