Class TypeDependency


  • public class TypeDependency
    extends java.lang.Object
    Encapsulates a single dependency of a type. One type can depend on another in a number of different ways depending on the nature of how the dependent type is injected. These differences are captured in the TypeDependency.Kind enumeration. The specific type implementation to be injected can be constrained using Qualifier annotations, specifically the Named annotation
    Since:
    19.3.0
    Author:
    cdivilly
    • Method Detail

      • description

        public java.lang.String description()
        Provides a textual description of a dependency
        Returns:
        String containing a description of the dependency
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • isEmpty

        public boolean isEmpty()
        Indicates if this dependency has any qualifiers
        Returns:
        true if the dependency has no qualifiers
      • isRequired

        public boolean isRequired()
      • qualifier

        public TypeQualifier<?> qualifier()
        The constraints on which implementation of the type to inject
        Returns:
        TypeQualifier instance
      • selector

        public java.lang.String selector()
        Produces the source code to replicate the selection of this dependency
        Returns:
        The source code to choose this dependency
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • type

        public java.lang.Class<?> type()
        The Class for the type to be injected
        Returns:
        The type of the dependency