public class ProviderClassSatisfaction extends Object implements Satisfaction, Serializable
Provider class capable of providing that type.| Constructor and Description |
|---|
ProviderClassSatisfaction(Class<? extends javax.inject.Provider<?>> providerType)
Create a ProviderClassSatisfaction that wraps a given provider type.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
CachePolicy |
getDefaultCachePolicy()
Get the default cache policy for instances created by this satisfaction.
|
List<Desire> |
getDependencies()
Get this satisfaction's dependencies.
|
Class<?> |
getErasedType()
Get the type-erased class of this satisfaction's type.
|
Class<? extends javax.inject.Provider<?>> |
getProviderType() |
Type |
getType()
Get the type of this satisfaction.
|
int |
hashCode() |
boolean |
hasInstance()
Query whether this satisfaction already has an instance to return.
|
Instantiator |
makeInstantiator(Map<Desire,Instantiator> dependencies,
LifecycleManager lm)
Create an instantiator from this satisfaction.
|
String |
toString() |
<T> T |
visit(SatisfactionVisitor<T> visitor)
Visit the satisfaction.
|
public ProviderClassSatisfaction(Class<? extends javax.inject.Provider<?>> providerType)
providerType - The provider class typeNullPointerException - if providerType is nullIllegalArgumentException - if the class is not a Provider, or is not instantiablepublic CachePolicy getDefaultCachePolicy()
SatisfactionSingleton can be used to specify a default. BindingFunctions are
allowed to overrule the default cache policy.getDefaultCachePolicy in interface Satisfactionpublic Class<? extends javax.inject.Provider<?>> getProviderType()
public List<Desire> getDependencies()
SatisfactiongetDependencies in interface Satisfactionpublic Type getType()
SatisfactiongetType in interface Satisfactionpublic Class<?> getErasedType()
SatisfactiongetErasedType in interface Satisfactionpublic boolean hasInstance()
SatisfactionhasInstance in interface Satisfactionpublic <T> T visit(SatisfactionVisitor<T> visitor)
Satisfactionvisit in interface SatisfactionT - The type returned from the visitor.visitor - The visitor object.public Instantiator makeInstantiator(Map<Desire,Instantiator> dependencies, LifecycleManager lm)
SatisfactionCreate an instantiator from this satisfaction.
If the details of the Satisfaction require instantiation (e.g. a class or
provider class satisfaction), the returned provider should be a new
instance, and it should perform no memoization of its own. Caching is the
purview of Injector implementations.
If the satisfaction is configured to use specific instances, this rule is obviously void.
makeInstantiator in interface Satisfactiondependencies - A function mapping desires to providers of their
instances.lm - The lifecycle manager (if one should be used).Copyright © 2016 GroupLens Research. All rights reserved.