Class LoggerContext.Builder
- java.lang.Object
-
- io.atomix.utils.logging.LoggerContext.Builder
-
- All Implemented Interfaces:
Builder<LoggerContext>
- Enclosing class:
- LoggerContext
public static class LoggerContext.Builder extends Object implements Builder<LoggerContext>
Contextual logger builder.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LoggerContext.Builderadd(String name, boolean value)Adds a name/value pair to the formatted output inname=valueformat.LoggerContext.Builderadd(String name, char value)Adds a name/value pair to the formatted output inname=valueformat.LoggerContext.Builderadd(String name, double value)Adds a name/value pair to the formatted output inname=valueformat.LoggerContext.Builderadd(String name, float value)Adds a name/value pair to the formatted output inname=valueformat.LoggerContext.Builderadd(String name, int value)Adds a name/value pair to the formatted output inname=valueformat.LoggerContext.Builderadd(String name, long value)Adds a name/value pair to the formatted output inname=valueformat.LoggerContext.Builderadd(String name, Object value)Adds a name/value pair to the formatted output inname=valueformat.LoggerContext.BuilderaddValue(boolean value)Adds an unnamed value to the formatted output.LoggerContext.BuilderaddValue(char value)Adds an unnamed value to the formatted output.LoggerContext.BuilderaddValue(double value)Adds an unnamed value to the formatted output.LoggerContext.BuilderaddValue(float value)Adds an unnamed value to the formatted output.LoggerContext.BuilderaddValue(int value)Adds an unnamed value to the formatted output.LoggerContext.BuilderaddValue(long value)Adds an unnamed value to the formatted output.LoggerContext.BuilderaddValue(Object value)Adds an unnamed value to the formatted output.LoggerContextbuild()Builds the object.LoggerContext.BuilderomitNullValues()Configures theMoreObjects.ToStringHelpersoObject.toString()will ignore properties with null value.
-
-
-
Constructor Detail
-
Builder
public Builder(String name)
-
-
Method Detail
-
omitNullValues
@CanIgnoreReturnValue public LoggerContext.Builder omitNullValues()
Configures theMoreObjects.ToStringHelpersoObject.toString()will ignore properties with null value. The order of calling this method, relative to theadd()/addValue()methods, is not significant.
-
add
@CanIgnoreReturnValue public LoggerContext.Builder add(String name, Object value)
Adds a name/value pair to the formatted output inname=valueformat. Ifvalueisnull, the string"null"is used, unlessomitNullValues()is called, in which case this name/value pair will not be added.
-
add
@CanIgnoreReturnValue public LoggerContext.Builder add(String name, boolean value)
Adds a name/value pair to the formatted output inname=valueformat.
-
add
@CanIgnoreReturnValue public LoggerContext.Builder add(String name, char value)
Adds a name/value pair to the formatted output inname=valueformat.
-
add
@CanIgnoreReturnValue public LoggerContext.Builder add(String name, double value)
Adds a name/value pair to the formatted output inname=valueformat.
-
add
@CanIgnoreReturnValue public LoggerContext.Builder add(String name, float value)
Adds a name/value pair to the formatted output inname=valueformat.
-
add
@CanIgnoreReturnValue public LoggerContext.Builder add(String name, int value)
Adds a name/value pair to the formatted output inname=valueformat.
-
add
@CanIgnoreReturnValue public LoggerContext.Builder add(String name, long value)
Adds a name/value pair to the formatted output inname=valueformat.
-
addValue
@CanIgnoreReturnValue public LoggerContext.Builder addValue(Object value)
Adds an unnamed value to the formatted output.It is strongly encouraged to use
add(String, Object)instead and give value a readable name.
-
addValue
@CanIgnoreReturnValue public LoggerContext.Builder addValue(boolean value)
Adds an unnamed value to the formatted output.It is strongly encouraged to use
add(String, boolean)instead and give value a readable name.
-
addValue
@CanIgnoreReturnValue public LoggerContext.Builder addValue(char value)
Adds an unnamed value to the formatted output.It is strongly encouraged to use
add(String, char)instead and give value a readable name.
-
addValue
@CanIgnoreReturnValue public LoggerContext.Builder addValue(double value)
Adds an unnamed value to the formatted output.It is strongly encouraged to use
add(String, double)instead and give value a readable name.
-
addValue
@CanIgnoreReturnValue public LoggerContext.Builder addValue(float value)
Adds an unnamed value to the formatted output.It is strongly encouraged to use
add(String, float)instead and give value a readable name.
-
addValue
@CanIgnoreReturnValue public LoggerContext.Builder addValue(int value)
Adds an unnamed value to the formatted output.It is strongly encouraged to use
add(String, int)instead and give value a readable name.
-
addValue
@CanIgnoreReturnValue public LoggerContext.Builder addValue(long value)
Adds an unnamed value to the formatted output.It is strongly encouraged to use
add(String, long)instead and give value a readable name.
-
build
public LoggerContext build()
Description copied from interface:BuilderBuilds the object.The 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.
- Specified by:
buildin interfaceBuilder<LoggerContext>- Returns:
- The built object.
-
-