public static class ColumnMapping.Builder extends Object implements Builder<ColumnMapping>
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
ColumnMapping |
build()
Builds the object after all configuration has been set.
|
ColumnMapping.Builder |
setConfiguration(Configuration configuration) |
ColumnMapping.Builder |
setLayout(StringLayout layout)
Layout of value to write to database (before type conversion).
|
ColumnMapping.Builder |
setLiteral(String literal)
Literal value to use for populating a column.
|
ColumnMapping.Builder |
setName(String name)
Column name.
|
ColumnMapping.Builder |
setPattern(String pattern)
Pattern to use as a
PatternLayout . |
ColumnMapping.Builder |
setType(Class<?> type)
Class to convert value to before storing in database.
|
public ColumnMapping.Builder setName(String name)
public ColumnMapping.Builder setLayout(StringLayout layout)
setType(Class)
is
a ReadOnlyStringMap
, ThreadContextMap
, or ThreadContextStack
.public ColumnMapping.Builder setPattern(String pattern)
PatternLayout
. Convenient shorthand for setLayout(StringLayout)
with a
PatternLayout.public ColumnMapping.Builder setLiteral(String literal)
public ColumnMapping.Builder setType(Class<?> type)
ThreadContextMap
or
ReadOnlyStringMap
, then the MDC will be used. If the type is compatible with ThreadContextStack
,
then the NDC will be used. If the type is compatible with Date
, then the event timestamp will be used.public ColumnMapping.Builder setConfiguration(Configuration configuration)
public ColumnMapping build()
Builder
build
in interface Builder<ColumnMapping>
Copyright © 1999-2017 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.