Class Key.Builder<T>

java.lang.Object
org.apache.logging.log4j.plugins.di.Key.Builder<T>
Type Parameters:
T - type of key
All Implemented Interfaces:
Supplier<Key<T>>
Enclosing class:
Key<T>

public static class Key.Builder<T> extends Object implements Supplier<Key<T>>
Builder class for configuring a new Key instance.
  • Method Details

    • setQualifierType

      public Key.Builder<T> setQualifierType(@Nullable Class<? extends Annotation> qualifierType)
      Specifies a qualifier annotation type. Qualifiers are optional and are used for an additional comparison property for keys.
    • setName

      public Key.Builder<T> setName(String name)
      Specifies the name of this key. The default name for keys is the empty string.
    • setNamespace

      public Key.Builder<T> setNamespace(String namespace)
      Specifies the namespace of this key. The default namespace for keys is the empty string.
    • setOrder

      public Key.Builder<T> setOrder(int order)
      Specifies the order of this key for disambiguation. This overrides any value discovered from the Ordered annotation on the type of the key.
    • get

      public Key<T> get()
      Creates a new Key from this builder's properties.
      Specified by:
      get in interface Supplier<T>