Interface Resolver<T>
- Type Parameters:
T- the type ofBindingvalue
- All Known Implementing Classes:
ChainedResolver, ConfigurationResolver, DefaultOptionResolver, OptionalResolver, ProviderResolver, ProvidesResolver, QualifiedResolver, SystemPropertyResolver
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
A facility to resolve
Bindings for Dependencys required for injection.
A Resolver may be defined for a single type of Binding for a Dependency
(monomorphic) or for numerous types of Bindings for Dependencys (polymorphic). When a
Resolver implementation is monomorphic, the resolvable type should be specified using the generic parameter
<T> for the Resolver. When a Resolver implementation is polymorphic, the generic parameter
<T> for the Resolver should be defined as Object, and not left as a raw type.
- Since:
- Oct-2024
- Author:
- brian.oliver
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Resolver<T> of(Function<? super Dependency, Optional<? extends Binding<T>>> function) resolve(Dependency dependency) Attempts to resolve a value for the type specified by theDependency.
-
Method Details
-
resolve
Attempts to resolve a value for the type specified by theDependency.- Parameters:
dependency- theDependency- Returns:
- the
Optionalvalue if resolvable,Optional.empty()otherwise
-
of
-