Class PluginOptionalFactoryResolver<T>
java.lang.Object
org.apache.logging.log4j.plugins.di.resolver.AbstractPluginFactoryResolver<Optional<? extends T>>
org.apache.logging.log4j.plugins.di.resolver.PluginOptionalFactoryResolver<T>
- All Implemented Interfaces:
FactoryResolver<Optional<? extends T>>
public class PluginOptionalFactoryResolver<T>
extends AbstractPluginFactoryResolver<Optional<? extends T>>
Factory resolver for
Optional<T>
plugin instances.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetFactory
(ResolvableKey<Optional<? extends T>> resolvableKey, InstanceFactory instanceFactory) Gets a factory for the given resolvable key using existing bindings from the given instance factory.protected boolean
supportsType
(Type rawType, Type... typeArguments) Methods inherited from class org.apache.logging.log4j.plugins.di.resolver.AbstractPluginFactoryResolver
supportsKey
-
Constructor Details
-
PluginOptionalFactoryResolver
public PluginOptionalFactoryResolver()
-
-
Method Details
-
supportsType
- Specified by:
supportsType
in classAbstractPluginFactoryResolver<Optional<? extends T>>
-
getFactory
public Supplier<Optional<? extends T>> getFactory(ResolvableKey<Optional<? extends T>> resolvableKey, InstanceFactory instanceFactory) Description copied from interface:FactoryResolver
Gets a factory for the given resolvable key using existing bindings from the given instance factory. A resolvable key in this context is aKey
combined with alias names and the annotated element this factory is for.- Parameters:
resolvableKey
- the resolvable key to create a binding forinstanceFactory
- the existing instance factory to use for composing bindings- Returns:
- a factory for instances described by the provided key
-