Module io.jstach.rainbowgum.pattern
Class PatternConfigBuilder
java.lang.Object
io.jstach.rainbowgum.pattern.format.PatternConfigBuilder
- All Implemented Interfaces:
LogBuilder<PatternConfigBuilder,
PatternConfig>
public final class PatternConfigBuilder
extends Object
implements LogBuilder<PatternConfigBuilder,PatternConfig>
Builder to create
PatternConfig
.
Property Pattern | Type | Required | Default | Description |
---|---|---|---|---|
"logging.pattern.config.{name}.zoneId" |
String (converted) |
false |
null |
|
"logging.pattern.config.{name}.lineSeparator" |
String |
false |
null |
|
"logging.pattern.config.{name}.ansiDisabled" |
Boolean |
false |
null |
-
Constructor Summary
ConstructorDescriptionPatternConfigBuilder
(String name) Create a builder forio.jstach.rainbowgum.pattern.format.PatternConfig
. -
Method Summary
Modifier and TypeMethodDescriptionansiDisabled
(@Nullable Boolean ansiDisabled) Sets ansiDisabled.build()
Createsio.jstach.rainbowgum.pattern.format.PatternConfig
from this builder.fromProperties
(LogProperties properties) Will try to convert string key values to parameters needed by the builder.lineSeparator
(@Nullable String lineSeparator) Sets lineSeparator.propertyFunction
(@Nullable Function<String, @Nullable String> propertyFunction) Sets propertyFunction.The interpolated property prefix: "logging.pattern.config.{name}.".void
toProperties
(BiConsumer<String, String> consumer) Turns the builder into java.util.Properties like Map skipping values that are null.Sets zoneId.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jstach.rainbowgum.LogBuilder
fromProperties
-
Constructor Details
-
PatternConfigBuilder
Create a builder forio.jstach.rainbowgum.pattern.format.PatternConfig
.- Parameters:
name
- will fill{name}
inlogging.pattern.config.{name}.
.
-
-
Method Details
-
propertyFunction
public PatternConfigBuilder propertyFunction(@Nullable Function<String, @Nullable String> propertyFunction) Sets propertyFunction. Default isnull
.- Parameters:
propertyFunction
- not configurable through properties- Returns:
- this builder.
-
zoneId
Sets zoneId. Default isnull
.- Parameters:
zoneId
-"logging.pattern.config.{name}.zoneId" = java.time.ZoneId
- Returns:
- this builder.
-
lineSeparator
Sets lineSeparator. Default isnull
.- Parameters:
lineSeparator
-"logging.pattern.config.{name}.lineSeparator" = java.lang.String
- Returns:
- this builder.
-
ansiDisabled
Sets ansiDisabled. Default isnull
.- Parameters:
ansiDisabled
-"logging.pattern.config.{name}.ansiDisabled" = java.lang.Boolean
- Returns:
- this builder.
-
build
Createsio.jstach.rainbowgum.pattern.format.PatternConfig
from this builder.- Returns:
io.jstach.rainbowgum.pattern.format.PatternConfig
.
-
fromProperties
Description copied from interface:LogBuilder
Will try to convert string key values to parameters needed by the builder.- Specified by:
fromProperties
in interfaceLogBuilder<PatternConfigBuilder,
PatternConfig> - Parameters:
properties
- log properties- Returns:
- this.
-
toProperties
Turns the builder into java.util.Properties like Map skipping values that are null.- Parameters:
consumer
- apply is called where first arg is key and second is value.
-
propertyPrefix
The interpolated property prefix: "logging.pattern.config.{name}.".- Specified by:
propertyPrefix
in interfaceLogBuilder<PatternConfigBuilder,
PatternConfig> - Returns:
- resolved prefix which should end with a "
.
". - See Also:
-