Interface ComponentBuilder<T extends ComponentBuilder<T>>

Type Parameters:
T - The ComponentBuilder's own type for fluent APIs.
All Superinterfaces:
Builder<Component>
All Known Subinterfaces:
AppenderComponentBuilder, AppenderRefComponentBuilder, CompositeFilterComponentBuilder, CustomLevelComponentBuilder, FilterableComponentBuilder<T>, FilterComponentBuilder, KeyValuePairComponentBuilder, LayoutComponentBuilder, LoggableComponentBuilder<T>, LoggerComponentBuilder, PropertyComponentBuilder, RootLoggerComponentBuilder, ScriptComponentBuilder, ScriptFileComponentBuilder

public interface ComponentBuilder<T extends ComponentBuilder<T>> extends Builder<Component>
Builds arbitrary components and is the base type for the provided components.
Since:
2.4
  • Method Details

    • addAttribute

      T addAttribute(String key, String value)
      Adds a String attribute.
      Parameters:
      key - The attribute key.
      value - The value of the attribute.
      Returns:
      This ComponentBuilder.
    • addAttribute

      T addAttribute(String key, Level level)
      Adds a logging Level attribute.
      Parameters:
      key - The attribute key.
      level - The logging Level.
      Returns:
      This ComponentBuilder.
    • addAttribute

      T addAttribute(String key, Enum<?> value)
      Adds an enumeration attribute.
      Parameters:
      key - The attribute key.
      value - The enumeration.
      Returns:
      This ComponentBuilder.
    • addAttribute

      T addAttribute(String key, int value)
      Adds an integer attribute.
      Parameters:
      key - The attribute key.
      value - The integer value.
      Returns:
      This ComponentBuilder.
    • addAttribute

      T addAttribute(String key, boolean value)
      Adds a boolean attribute.
      Parameters:
      key - The attribute key.
      value - The boolean value.
      Returns:
      This ComponentBuilder.
    • addAttribute

      T addAttribute(String key, Object value)
      Adds an Object attribute.
      Parameters:
      key - The attribute key.
      value - The object value.
      Returns:
      This ComponentBuilder.
    • addComponent

      T addComponent(ComponentBuilder<?> builder)
      Adds a sub component.
      Parameters:
      builder - The Assembler for the subcomponent with all of its attributes and sub-components set.
      Returns:
      This ComponentBuilder (not the argument).
    • getName

      String getName()
      Returns the name of the component, if any.
      Returns:
      The component's name or null if it doesn't have one.
    • getBuilder

      ConfigurationBuilder<? extends Configuration> getBuilder()
      Retrieves the ConfigurationBuilder.
      Returns:
      The ConfigurationBuilder.