Interface Injectable<T>

  • Type Parameters:
    T - the type of the instances produced
    All Superinterfaces:
    Constructable<T>

    public interface Injectable<T>
    extends Constructable<T>
    Represents a source for an injectable dependency. Injectables can be provided in various ways, either by creating a new instance of a class, by using a known instance or by asking a provider for an instance.

    Implementations of this interface must provide implementations of Object.equals(Object) and Object.hashCode(). Two injectables are considered equal when the full generic type is equal, their qualifiers are equal and they come from the exact same source (same class, same method, same field, etc.)

    • Method Detail

      • getType

        java.lang.reflect.Type getType()
        Returns the Type which is always fully resolved (no type variables) and never void.
        Returns:
        the Type, never null
      • getTypes

        java.util.Set<java.lang.reflect.Type> getTypes()
        Returns the Types of this injectable.
        Returns:
        the Types of this injectable, never null, empty or contains null
      • getQualifiers

        java.util.Set<java.lang.annotation.Annotation> getQualifiers()
        Returns an unmodifiable set of qualifier Annotations.
        Returns:
        an unmodifiable set of qualifier Annotations, never null and never contains nulls but can be empty
      • getBindings

        java.util.List<Binding> getBindings()
        Returns the Bindings detected.
        Returns:
        a list Bindings, never null, can be empty if no bindings are detected