public interface TagExtractor<T>
Tag should follow the OpenTracing tag names. This might change in the future if a new spec with a superset (semantically wise) of this list.
Modifier and Type | Method and Description |
---|---|
static <T> TagExtractor<T> |
empty() |
default Map<String,String> |
extract(T obj)
Extract all the tags from
obj into a Map<String, String> . |
default void |
extractTo(T obj,
java.util.function.BiConsumer<String,String> consumer)
Extract all the tags from
obj into a tag consumer . |
default void |
extractTo(T obj,
Map<String,String> tags)
Extract all the tags from
obj into the tags map. |
default int |
len(T obj)
Returns the number of tags
obj exposes. |
default String |
name(T obj,
int index)
Returns the name of the tag extracted from
obj at the specified index . |
default String |
value(T obj,
int index)
Returns the value of the tag extracted from
obj at the specified index . |
static <T> TagExtractor<T> empty()
default int len(T obj)
obj
exposes.obj
- the object to evaluatedefault String name(T obj, int index)
obj
at the specified index
.obj
- the object to extract the tag name fromindex
- the index of the tagdefault String value(T obj, int index)
obj
at the specified index
.obj
- the object to extract the tag name fromindex
- the index of the tagdefault Map<String,String> extract(T obj)
obj
into a Map<String, String>
.obj
- the object to extract the tags fromdefault void extractTo(T obj, Map<String,String> tags)
obj
into the tags
map.obj
- the object to extract the tags fromtags
- the map populated with the tags extracted from the objectdefault void extractTo(T obj, java.util.function.BiConsumer<String,String> consumer)
obj
into a tag consumer
.obj
- the object to extract the tags fromconsumer
- the consumer populated with the tags extracted from the objectCopyright © 2023 Eclipse. All rights reserved.