Interface ComponentBuilder<T extends ComponentBuilder<T>>
-
- Type Parameters:
T- The ComponentBuilder's own type for fluent APIs.
- All Known Subinterfaces:
AppenderComponentBuilder,AppenderRefComponentBuilder,CompositeFilterComponentBuilder,CustomLevelComponentBuilder,FilterableComponentBuilder<T>,FilterComponentBuilder,KeyValuePairComponentBuilder,LayoutComponentBuilder,LoggableComponentBuilder<T>,LoggerComponentBuilder,PropertyComponentBuilder,RootLoggerComponentBuilder,ScriptComponentBuilder,ScriptFileComponentBuilder
- All Known Implementing Classes:
DefaultAppenderComponentBuilder,DefaultAppenderRefComponentBuilder,DefaultComponentAndConfigurationBuilder,DefaultComponentBuilder,DefaultCompositeFilterComponentBuilder,DefaultCustomLevelComponentBuilder,DefaultFilterComponentBuilder,DefaultKeyValuePairComponentBuilder,DefaultLayoutComponentBuilder,DefaultLoggerComponentBuilder,DefaultPropertyComponentBuilder,DefaultRootLoggerComponentBuilder,DefaultScriptComponentBuilder,DefaultScriptFileComponentBuilder
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description TaddAttribute(java.lang.String key, boolean value)Adds a boolean attribute.TaddAttribute(java.lang.String key, int value)Adds an integer attribute.TaddAttribute(java.lang.String key, java.lang.Enum<?> value)Adds an enumeration attribute.TaddAttribute(java.lang.String key, java.lang.Object value)Adds an Object attribute.TaddAttribute(java.lang.String key, java.lang.String value)Adds a String attribute.TaddAttribute(java.lang.String key, Level level)Adds a logging Level attribute.TaddComponent(ComponentBuilder<?> builder)Adds a sub component.ConfigurationBuilder<? extends Configuration>getBuilder()Retrieves the ConfigurationBuilder.java.lang.StringgetName()Returns the name of the component, if any.-
Methods inherited from interface org.apache.logging.log4j.core.util.Builder
build, getErrorPrefix, isValid
-
-
-
-
Method Detail
-
addAttribute
T addAttribute(java.lang.String key, java.lang.String value)
Adds a String attribute.- Parameters:
key- The attribute key.value- The value of the attribute.- Returns:
- This ComponentBuilder.
-
addAttribute
T addAttribute(java.lang.String key, Level level)
Adds a logging Level attribute.- Parameters:
key- The attribute key.level- The logging Level.- Returns:
- This ComponentBuilder.
-
addAttribute
T addAttribute(java.lang.String key, java.lang.Enum<?> value)
Adds an enumeration attribute.- Parameters:
key- The attribute key.value- The enumeration.- Returns:
- This ComponentBuilder.
-
addAttribute
T addAttribute(java.lang.String key, int value)
Adds an integer attribute.- Parameters:
key- The attribute key.value- The integer value.- Returns:
- This ComponentBuilder.
-
addAttribute
T addAttribute(java.lang.String key, boolean value)
Adds a boolean attribute.- Parameters:
key- The attribute key.value- The boolean value.- Returns:
- This ComponentBuilder.
-
addAttribute
T addAttribute(java.lang.String key, java.lang.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
java.lang.String getName()
Returns the name of the component, if any.- Returns:
- The components name or null if it doesn't have one.
-
getBuilder
ConfigurationBuilder<? extends Configuration> getBuilder()
Retrieves the ConfigurationBuilder.- Returns:
- The ConfigurationBuilder.
-
-