Class DefaultComponentBuilder<T extends ComponentBuilder<T>,CB extends ConfigurationBuilder<? extends Configuration>>
java.lang.Object
org.apache.logging.log4j.core.config.builder.impl.DefaultComponentBuilder<T,CB>
- All Implemented Interfaces:
ComponentBuilder<T>
,Builder<Component>
- Direct Known Subclasses:
DefaultComponentAndConfigurationBuilder
class DefaultComponentBuilder<T extends ComponentBuilder<T>,CB extends ConfigurationBuilder<? extends Configuration>>
extends Object
implements ComponentBuilder<T>
Generic component that captures attributes and Components in preparation for assembling the Appender's
Component.
- Since:
- 2.4
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultComponentBuilder
(CB builder, String type) DefaultComponentBuilder
(CB builder, String name, String type) DefaultComponentBuilder
(CB builder, String name, String type, String value) -
Method Summary
Modifier and TypeMethodDescriptionaddAttribute
(String key, boolean value) Adds a boolean attribute.addAttribute
(String key, int value) Adds an integer attribute.addAttribute
(String key, Enum<?> value) Adds an enumeration attribute.addAttribute
(String key, Object value) Adds an Object attribute.addAttribute
(String key, String value) Adds a String attribute.addAttribute
(String key, Level level) Adds a logging Level attribute.addComponent
(ComponentBuilder<?> builder) Adds a sub component.build()
Builds the object after all configuration has been set.Retrieves the ConfigurationBuilder.getName()
Returns the name of the component, if any.protected T
-
Field Details
-
builder
-
type
-
attributes
-
components
-
name
-
value
-
-
Constructor Details
-
DefaultComponentBuilder
-
DefaultComponentBuilder
-
DefaultComponentBuilder
-
-
Method Details
-
addAttribute
Description copied from interface:ComponentBuilder
Adds a boolean attribute.- Specified by:
addAttribute
in interfaceComponentBuilder<T extends ComponentBuilder<T>>
- Parameters:
key
- The attribute key.value
- The boolean value.- Returns:
- This ComponentBuilder.
-
addAttribute
Description copied from interface:ComponentBuilder
Adds an enumeration attribute.- Specified by:
addAttribute
in interfaceComponentBuilder<T extends ComponentBuilder<T>>
- Parameters:
key
- The attribute key.value
- The enumeration.- Returns:
- This ComponentBuilder.
-
addAttribute
Description copied from interface:ComponentBuilder
Adds an integer attribute.- Specified by:
addAttribute
in interfaceComponentBuilder<T extends ComponentBuilder<T>>
- Parameters:
key
- The attribute key.value
- The integer value.- Returns:
- This ComponentBuilder.
-
addAttribute
Description copied from interface:ComponentBuilder
Adds a logging Level attribute.- Specified by:
addAttribute
in interfaceComponentBuilder<T extends ComponentBuilder<T>>
- Parameters:
key
- The attribute key.level
- The logging Level.- Returns:
- This ComponentBuilder.
-
addAttribute
Description copied from interface:ComponentBuilder
Adds an Object attribute.- Specified by:
addAttribute
in interfaceComponentBuilder<T extends ComponentBuilder<T>>
- Parameters:
key
- The attribute key.value
- The object value.- Returns:
- This ComponentBuilder.
-
addAttribute
Description copied from interface:ComponentBuilder
Adds a String attribute.- Specified by:
addAttribute
in interfaceComponentBuilder<T extends ComponentBuilder<T>>
- Parameters:
key
- The attribute key.value
- The value of the attribute.- Returns:
- This ComponentBuilder.
-
addComponent
Description copied from interface:ComponentBuilder
Adds a sub component.- Specified by:
addComponent
in interfaceComponentBuilder<T extends ComponentBuilder<T>>
- Parameters:
builder
- The Assembler for the subcomponent with all of its attributes and sub-components set.- Returns:
- This ComponentBuilder (not the argument).
-
build
Description copied from interface:Builder
Builds the object after all configuration has been set. This will use default values for any unspecified attributes for the object.- Specified by:
build
in interfaceBuilder<T extends ComponentBuilder<T>>
- Returns:
- the configured instance.
-
getBuilder
Description copied from interface:ComponentBuilder
Retrieves the ConfigurationBuilder.- Specified by:
getBuilder
in interfaceComponentBuilder<T extends ComponentBuilder<T>>
- Returns:
- The ConfigurationBuilder.
-
getName
Description copied from interface:ComponentBuilder
Returns the name of the component, if any.- Specified by:
getName
in interfaceComponentBuilder<T extends ComponentBuilder<T>>
- Returns:
- The components name or null if it doesn't have one.
-
put
-