kairosdb-client
kairosdb-client copied to clipboard
On Varargs
This is mainly a stylistic question, but instead of varargs values, wouldn't most just make a set? I can't imagine a scenario where you would want duplicate values for a tag, and a set could force uniqueness.
public QueryTagMetric addTag(String name, String... values)
{
checkNotNullOrEmpty(name, "name cannot be null or empty");
checkArgument(values.length > 0, "value must be greater than 0");
for (String value : values)
{
checkNotNullOrEmpty(value, "value cannot be null or empty");
}
tags.putAll(name, Arrays.asList(values));
return (this);
}
You are correct. The code should be fixed to ensure tags are unique.
@jsabin What do you think about my PR?
Was this ever going to get merged?
Yeah just merged it. Didn't realize how long this was sitting round.