Package io.spine.logging.flogger.context
Class Tags.Builder
- java.lang.Object
-
- io.spine.logging.flogger.context.Tags.Builder
-
-
Constructor Summary
Constructors Constructor Description Builder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Tags.BuilderaddTag(String name)Adds an empty tag, ensuring that the given name exists in the tag map with at least an empty set of values.Tags.BuilderaddTag(String name, boolean value)Adds a boolean value for the given name, ensuring that the values for the given name contain at least this value.Tags.BuilderaddTag(String name, double value)Adds a double value for the given name, ensuring that the values for the given name contain at least this value.Tags.BuilderaddTag(String name, long value)Adds a long value for the given name, ensuring that the values for the given name contain at least this value.Tags.BuilderaddTag(String name, String value)Adds a string value for the given name, ensuring that the values for the given name contain at least this value.Tagsbuild()Returns an immutable tags instance.StringtoString()
-
-
-
Method Detail
-
addTag
@CanIgnoreReturnValue public Tags.Builder addTag(String name)
Adds an empty tag, ensuring that the given name exists in the tag map with at least an empty set of values. Adding the same name more than once has no effect.When viewed as a
Set, the value for an empty tag is just the empty set. However if other values are added for the same name, the set of values will no longer be empty and the call toaddTag(String)will have had no lasting effect.
-
addTag
@CanIgnoreReturnValue public Tags.Builder addTag(String name, String value)
Adds a string value for the given name, ensuring that the values for the given name contain at least this value. Adding the same name/value pair more than once has no effect.
-
addTag
@CanIgnoreReturnValue public Tags.Builder addTag(String name, boolean value)
Adds a boolean value for the given name, ensuring that the values for the given name contain at least this value. Adding the same name/value pair more than once has no effect.
-
addTag
@CanIgnoreReturnValue public Tags.Builder addTag(String name, long value)
Adds a long value for the given name, ensuring that the values for the given name contain at least this value. Adding the same name/value pair more than once has no effect.Note however that for numeric values, differing types (long/double) are always considered distinct, so invoking both
addTag("foo", 1234L)andaddTag("foo", 1234.0D)will result in two values for the tag.
-
addTag
@CanIgnoreReturnValue public Tags.Builder addTag(String name, double value)
Adds a double value for the given name, ensuring that the values for the given name contain at least this value. Adding the same name/value pair more than once has no effect.Note however that for numeric values, differing types (long/double) are always considered distinct, so invoking both
addTag("foo", 1234L)andaddTag("foo", 1234.0D)will result in two values for the tag.
-
build
public Tags build()
Returns an immutable tags instance.
-
-