public static class LoggerContext.Builder extends Object implements Builder<LoggerContext>
| Modifier and Type | Method and Description |
|---|---|
LoggerContext.Builder |
add(String name,
boolean value)
Adds a name/value pair to the formatted output in
name=value format. |
LoggerContext.Builder |
add(String name,
char value)
Adds a name/value pair to the formatted output in
name=value format. |
LoggerContext.Builder |
add(String name,
double value)
Adds a name/value pair to the formatted output in
name=value format. |
LoggerContext.Builder |
add(String name,
float value)
Adds a name/value pair to the formatted output in
name=value format. |
LoggerContext.Builder |
add(String name,
int value)
Adds a name/value pair to the formatted output in
name=value format. |
LoggerContext.Builder |
add(String name,
long value)
Adds a name/value pair to the formatted output in
name=value format. |
LoggerContext.Builder |
add(String name,
Object value)
Adds a name/value pair to the formatted output in
name=value format. |
LoggerContext.Builder |
addValue(boolean value)
Adds an unnamed value to the formatted output.
|
LoggerContext.Builder |
addValue(char value)
Adds an unnamed value to the formatted output.
|
LoggerContext.Builder |
addValue(double value)
Adds an unnamed value to the formatted output.
|
LoggerContext.Builder |
addValue(float value)
Adds an unnamed value to the formatted output.
|
LoggerContext.Builder |
addValue(int value)
Adds an unnamed value to the formatted output.
|
LoggerContext.Builder |
addValue(long value)
Adds an unnamed value to the formatted output.
|
LoggerContext.Builder |
addValue(Object value)
Adds an unnamed value to the formatted output.
|
LoggerContext |
build()
Builds the object.
|
LoggerContext.Builder |
omitNullValues()
Configures the
MoreObjects.ToStringHelper so Object.toString() will ignore properties with null
value. |
public Builder(String name)
public LoggerContext.Builder omitNullValues()
MoreObjects.ToStringHelper so Object.toString() will ignore properties with null
value. The order of calling this method, relative to the add()/addValue()
methods, is not significant.public LoggerContext.Builder add(String name, Object value)
name=value format. If value
is null, the string "null" is used, unless omitNullValues() is
called, in which case this name/value pair will not be added.public LoggerContext.Builder add(String name, boolean value)
name=value format.public LoggerContext.Builder add(String name, char value)
name=value format.public LoggerContext.Builder add(String name, double value)
name=value format.public LoggerContext.Builder add(String name, float value)
name=value format.public LoggerContext.Builder add(String name, int value)
name=value format.public LoggerContext.Builder add(String name, long value)
name=value format.public LoggerContext.Builder addValue(Object value)
It is strongly encouraged to use add(String, Object) instead and give value a
readable name.
public LoggerContext.Builder addValue(boolean value)
It is strongly encouraged to use add(String, boolean) instead and give value a
readable name.
public LoggerContext.Builder addValue(char value)
It is strongly encouraged to use add(String, char) instead and give value a
readable name.
public LoggerContext.Builder addValue(double value)
It is strongly encouraged to use add(String, double) instead and give value a
readable name.
public LoggerContext.Builder addValue(float value)
It is strongly encouraged to use add(String, float) instead and give value a
readable name.
public LoggerContext.Builder addValue(int value)
It is strongly encouraged to use add(String, int) instead and give value a
readable name.
public LoggerContext.Builder addValue(long value)
It is strongly encouraged to use add(String, long) instead and give value a
readable name.
public LoggerContext build()
BuilderThe returned object may be a new instance of the built class or a recycled instance, depending on the semantics of the builder implementation. Users should never assume that a builder allocates a new instance.
build in interface Builder<LoggerContext>Copyright © 2013–2018. All rights reserved.