|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.netflix.servo.tag.BasicTagList
public final class BasicTagList
Immutable tag list.
| Field Summary | |
|---|---|
static TagList |
EMPTY
An empty tag list. |
| Constructor Summary | |
|---|---|
BasicTagList(java.lang.Iterable<Tag> entries)
Creates a new instance with a fixed set of tags. |
|
| Method Summary | |
|---|---|
java.util.Map<java.lang.String,java.lang.String> |
asMap()
Returns a map containing a copy of the tags in this list. |
static BasicTagList |
concat(TagList t1,
Tag... t2)
Returns a tag list containing the union of t1 and t2. |
static BasicTagList |
concat(TagList t1,
TagList t2)
Returns a tag list containing the union of t1 and t2. |
boolean |
containsKey(java.lang.String key)
Returns true if this list has a tag with the given key. |
BasicTagList |
copy(java.lang.String key,
java.lang.String value)
Returns a new tag list with an additional tag. |
BasicTagList |
copy(TagList tags)
Returns a new tag list with additional tags from tags. |
static BasicTagList |
copyOf(java.lang.Iterable<java.lang.String> tags)
Returns a tag list that has a copy of tags. |
static BasicTagList |
copyOf(java.util.Map<java.lang.String,java.lang.String> tags)
Returns a tag list that has a copy of tags. |
static BasicTagList |
copyOf(java.lang.String... tags)
Deprecated. Use of(String...) with separate key, values instead. |
static BasicTagList |
copyOf(Tag... tags)
Deprecated. Use of(Tag...) |
boolean |
equals(java.lang.Object obj)
|
Tag |
getTag(java.lang.String key)
Returns the tag matching a given key or null if not match is found. |
java.lang.String |
getValue(java.lang.String key)
Returns the value matching a given key or null if not match is found. |
int |
hashCode()
|
boolean |
isEmpty()
Returns true if this list is emtpy. |
java.util.Iterator<Tag> |
iterator()
|
static BasicTagList |
of(java.lang.String... tags)
Returns a tag list from the list of key values passed. |
static BasicTagList |
of(Tag... tags)
Returns a tag list from the tags. |
int |
size()
Returns the number of tags in this list. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final TagList EMPTY
| Constructor Detail |
|---|
public BasicTagList(java.lang.Iterable<Tag> entries)
entries - entries to include in this tag list| Method Detail |
|---|
public Tag getTag(java.lang.String key)
getTag in interface TagListpublic java.lang.String getValue(java.lang.String key)
getValue in interface TagListpublic boolean containsKey(java.lang.String key)
containsKey in interface TagListpublic boolean isEmpty()
isEmpty in interface TagListpublic int size()
size in interface TagListpublic java.util.Iterator<Tag> iterator()
iterator in interface TagListiterator in interface java.lang.Iterable<Tag>public java.util.Map<java.lang.String,java.lang.String> asMap()
asMap in interface TagListpublic BasicTagList copy(TagList tags)
tags. If there
is a conflict with tag keys the tag from tags will be used.
public BasicTagList copy(java.lang.String key,
java.lang.String value)
key is
already present in this tag list the value will be overwritten with
value.
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Object
public static BasicTagList concat(TagList t1,
TagList t2)
t1 and t2.
If there is a conflict with tag keys, the tag from t2 will be
used.
public static BasicTagList concat(TagList t1,
Tag... t2)
t1 and t2.
If there is a conflict with tag keys, the tag from t2 will be
used.
public static BasicTagList of(java.lang.String... tags)
BasicTagList tagList = BasicTagList.of("id", "someId", "class", "someClass");
public static BasicTagList of(Tag... tags)
@Deprecated public static BasicTagList copyOf(Tag... tags)
of(Tag...)
tags.
@Deprecated public static BasicTagList copyOf(java.lang.String... tags)
of(String...) with separate key, values instead.
tags. Each tag value
is expected to be a string parseable using BasicTag.parseTag(java.lang.String).
public static BasicTagList copyOf(java.lang.Iterable<java.lang.String> tags)
tags. Each tag value
is expected to be a string parseable using BasicTag.parseTag(java.lang.String).
public static BasicTagList copyOf(java.util.Map<java.lang.String,java.lang.String> tags)
tags.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||