Package io.quarkus.arc
Interface InjectableInstance<T>
- Type Parameters:
T-
- All Superinterfaces:
jakarta.enterprise.inject.Instance<T>,Iterable<T>,jakarta.inject.Provider<T>
- All Known Implementing Classes:
InstanceImpl
public interface InjectableInstance<T>
extends jakarta.enterprise.inject.Instance<T>
Enhanced version of
Instance.-
Nested Class Summary
Nested classes/interfaces inherited from interface jakarta.enterprise.inject.Instance
jakarta.enterprise.inject.Instance.Handle<T extends Object> -
Method Summary
Modifier and TypeMethodDescriptionvoidRemoves the cached result of theProvider.get()operation.handles()iterator()This method attempts to resolve ambiguities.default TIf there is exactly one bean that matches the required type and qualifiers, returns the instance, otherwise returnsother.default TorNull()If there is exactly one bean that matches the required type and qualifiers, returns the instance, otherwise returnsnull.<U extends T>
InjectableInstance<U>select(jakarta.enterprise.util.TypeLiteral<U> subtype, Annotation... qualifiers) select(Annotation... qualifiers) <U extends T>
InjectableInstance<U>select(Class<U> subtype, Annotation... qualifiers) Methods inherited from interface jakarta.enterprise.inject.Instance
destroy, handlesStream, isAmbiguous, isResolvable, isUnsatisfied, streamMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface jakarta.inject.Provider
get
-
Method Details
-
getHandle
InstanceHandle<T> getHandle()- Specified by:
getHandlein interfacejakarta.enterprise.inject.Instance<T>
-
handles
Iterable<InstanceHandle<T>> handles()- Specified by:
handlesin interfacejakarta.enterprise.inject.Instance<T>
-
select
- Specified by:
selectin interfacejakarta.enterprise.inject.Instance<T>
-
select
- Specified by:
selectin interfacejakarta.enterprise.inject.Instance<T>
-
select
<U extends T> InjectableInstance<U> select(jakarta.enterprise.util.TypeLiteral<U> subtype, Annotation... qualifiers) - Specified by:
selectin interfacejakarta.enterprise.inject.Instance<T>
-
clearCache
void clearCache()Removes the cached result of theProvider.get()operation. If the cached result was a contextual reference of aDependentbean, destroy the reference as well.- See Also:
-
iterator
This method attempts to resolve ambiguities.In general, if multiple beans are eligible then the container eliminates all beans that are:
- not alternatives, except for producer methods and fields of beans that are alternatives,
- default beans.
-
orElse
If there is exactly one bean that matches the required type and qualifiers, returns the instance, otherwise returnsother.- Parameters:
other-- Returns:
- the bean instance or the other value
-
orNull
If there is exactly one bean that matches the required type and qualifiers, returns the instance, otherwise returnsnull.- Parameters:
other-- Returns:
- the bean instance or
null
-