Interface DependencyChain

All Superinterfaces:
Iterable<Key<?>>

public interface DependencyChain extends Iterable<Key<?>>
Immutable chain of dependency keys assembled while constructing dependency-injected instances.
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns an empty dependency chain.
    boolean
    Indicates if the given key is contained in this dependency chain.
    boolean
    Indicates whether this dependency chain is empty.
    of(Key<?> key)
    Returns a dependency chain containing a single key.
    Returns a new dependency chain containing the provided key as an additional dependency.

    Methods inherited from interface java.lang.Iterable

    forEach, iterator, spliterator
  • Method Details

    • hasDependency

      boolean hasDependency(Key<?> key)
      Indicates if the given key is contained in this dependency chain.
    • withDependency

      DependencyChain withDependency(Key<?> key)
      Returns a new dependency chain containing the provided key as an additional dependency. If the given key already exists, then it will not be added to the chain.
    • isEmpty

      boolean isEmpty()
      Indicates whether this dependency chain is empty.
    • empty

      static DependencyChain empty()
      Returns an empty dependency chain.
    • of

      static DependencyChain of(Key<?> key)
      Returns a dependency chain containing a single key.