Class LazyBeanEntry<Q extends Annotation,T>

java.lang.Object
org.eclipse.sisu.inject.LazyBeanEntry<Q,T>
All Implemented Interfaces:
Map.Entry<Q,T>, BeanEntry<Q,T>

final class LazyBeanEntry<Q extends Annotation,T> extends Object implements BeanEntry<Q,T>
Lazy BeanEntry backed by a qualified Binding and an assigned rank.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    private static final class 
    Implementation of @Named that can also act like @Named.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    (package private) final com.google.inject.Binding<T>
     
    private final javax.inject.Provider<T>
     
    private final Q
     
    private final int
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    LazyBeanEntry(Q qualifier, com.google.inject.Binding<T> binding, int rank)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns a human-readable description of the bean; see @Description.
    Attempts to find the implementation type without creating the bean instance.
    Returns the @Qualifier annotation associated with this particular bean.
    javax.inject.Provider<T>
    Returns the underlying Provider; may support creation of multiple instances.
    int
    Returns the bean's rank; higher ranked beans override lower ranked beans.
    Returns an arbitrary object that indicates where this bean was configured.
    Returns the associated instance of the bean; returns same instance for each call.
    setValue(T value)
     
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface java.util.Map.Entry

    equals, hashCode
  • Field Details

    • qualifier

      private final Q extends Annotation qualifier
    • binding

      final com.google.inject.Binding<T> binding
    • lazyValue

      private final javax.inject.Provider<T> lazyValue
    • rank

      private final int rank
  • Constructor Details

    • LazyBeanEntry

      LazyBeanEntry(Q qualifier, com.google.inject.Binding<T> binding, int rank)
  • Method Details

    • getKey

      public Q getKey()
      Description copied from interface: BeanEntry
      Returns the @Qualifier annotation associated with this particular bean.
      Specified by:
      getKey in interface BeanEntry<Q extends Annotation,T>
      Specified by:
      getKey in interface Map.Entry<Q extends Annotation,T>
      Returns:
      Qualifier annotation
    • getValue

      public T getValue()
      Description copied from interface: BeanEntry
      Returns the associated instance of the bean; returns same instance for each call.
      Specified by:
      getValue in interface BeanEntry<Q extends Annotation,T>
      Specified by:
      getValue in interface Map.Entry<Q extends Annotation,T>
      Returns:
      Bean instance (lazily-created)
    • setValue

      public T setValue(T value)
      Specified by:
      setValue in interface Map.Entry<Q extends Annotation,T>
    • getProvider

      public javax.inject.Provider<T> getProvider()
      Description copied from interface: BeanEntry
      Returns the underlying Provider; may support creation of multiple instances.
      Specified by:
      getProvider in interface BeanEntry<Q extends Annotation,T>
      Returns:
      Bean provider
    • getDescription

      public String getDescription()
      Description copied from interface: BeanEntry
      Returns a human-readable description of the bean; see @Description.
      Specified by:
      getDescription in interface BeanEntry<Q extends Annotation,T>
      Returns:
      Human-readable description
      See Also:
    • getImplementationClass

      public Class<T> getImplementationClass()
      Description copied from interface: BeanEntry
      Attempts to find the implementation type without creating the bean instance.
      Specified by:
      getImplementationClass in interface BeanEntry<Q extends Annotation,T>
      Returns:
      Implementation type; null if the type cannot be determined
    • getSource

      public Object getSource()
      Description copied from interface: BeanEntry
      Returns an arbitrary object that indicates where this bean was configured.
      Specified by:
      getSource in interface BeanEntry<Q extends Annotation,T>
      Returns:
      Source location
    • getRank

      public int getRank()
      Description copied from interface: BeanEntry
      Returns the bean's rank; higher ranked beans override lower ranked beans.
      Specified by:
      getRank in interface BeanEntry<Q extends Annotation,T>
      Returns:
      Assigned rank
      See Also:
    • toString

      public String toString()
      Overrides:
      toString in class Object