T - The type of the service that was locatedpublic interface InstanceProvider<T> extends Iterable<T>, javax.inject.Provider<T>, Supplier<T>
Provider specialization that provides the ability to:
isUnsatisfied()isAmbiguous()iterator()InstanceLocator| Modifier and Type | Method and Description |
|---|---|
T |
get()
Retrieve the first available instance
|
boolean |
hasMultiple()
Determines if there is more than one available implementation for the required type and qualifiers
|
default boolean |
isAmbiguous()
Determines if there is more than one available implementation for the required type and qualifiers.
|
default boolean |
isAvailable()
Indicates if at least one matching provider is found
|
default boolean |
isUnavailable()
Equivalent to
isUnsatisfied() |
boolean |
isUnsatisfied()
Determines if there is no available implementation for the required type and qualifiers.
|
Iterator<T> |
iterator()
When a service has multiple providers (which can be determined by calling
isAmbiguous()) this iterator enumerates each of the available providers |
TypeQualifier<T> |
qualifier()
Identifies the constraints used to select matches
|
forEach, spliteratorT get()
get in interface javax.inject.Provider<T>get in interface Supplier<T>TypeDependencyNotAvailableException - if no instance is availableboolean hasMultiple()
default boolean isAmbiguous()
hasMultiple()default boolean isAvailable()
default boolean isUnavailable()
isUnsatisfied()boolean isUnsatisfied()
get() will raise a RuntimeExceptionIterator<T> iterator()
isAmbiguous()) this iterator enumerates each of the available providersTypeQualifier<T> qualifier()
TypeQualifier instance