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 to addTag will have had no lasting effect.


@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.


@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.


@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) and addTag("foo", 1234.0D) will result in two values for the tag.


@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) and addTag("foo", 1234.0D) will result in two values for the tag.