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 Details

    • PluginOptionalFactoryResolver

      public PluginOptionalFactoryResolver()
  • Method Details

    • supportsType

      protected boolean supportsType(Type rawType, Type... typeArguments)
      Specified by:
      supportsType in class AbstractPluginFactoryResolver<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 a Key combined with alias names and the annotated element this factory is for.
      Parameters:
      resolvableKey - the resolvable key to create a binding for
      instanceFactory - the existing instance factory to use for composing bindings
      Returns:
      a factory for instances described by the provided key