Package io.vertx.core.spi.tracing
Interface TagExtractor<T>
-
public interface TagExtractor<T>
This provides an utility for extracting request/response tags, potentially allocation-free.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.
- Author:
- Julien Viet
-
-
Method Summary
All Methods Static Methods Instance Methods Default Methods Modifier and Type Method Description static <T> TagExtractor<T>
empty()
default Map<String,String>
extract(T obj)
Extract all the tags fromobj
into aMap<String, String>
.default void
extractTo(T obj, BiConsumer<String,String> consumer)
Extract all the tags fromobj
into a tagconsumer
.default void
extractTo(T obj, Map<String,String> tags)
Extract all the tags fromobj
into thetags
map.default int
len(T obj)
Returns the number of tagsobj
exposes.default String
name(T obj, int index)
Returns the name of the tag extracted fromobj
at the specifiedindex
.default String
value(T obj, int index)
Returns the value of the tag extracted fromobj
at the specifiedindex
.
-
-
-
Method Detail
-
empty
static <T> TagExtractor<T> empty()
-
len
default int len(T obj)
Returns the number of tagsobj
exposes.- Parameters:
obj
- the object to evaluate- Returns:
- the number of tags
-
name
default String name(T obj, int index)
Returns the name of the tag extracted fromobj
at the specifiedindex
.- Parameters:
obj
- the object to extract the tag name fromindex
- the index of the tag- Returns:
- the tag name
-
value
default String value(T obj, int index)
Returns the value of the tag extracted fromobj
at the specifiedindex
.- Parameters:
obj
- the object to extract the tag name fromindex
- the index of the tag- Returns:
- the tag value
-
extract
default Map<String,String> extract(T obj)
Extract all the tags fromobj
into aMap<String, String>
.- Parameters:
obj
- the object to extract the tags from- Returns:
- the map of all tags extracted from the object
-
extractTo
default void extractTo(T obj, Map<String,String> tags)
Extract all the tags fromobj
into thetags
map.- Parameters:
obj
- the object to extract the tags fromtags
- the map populated with the tags extracted from the object
-
extractTo
default void extractTo(T obj, BiConsumer<String,String> consumer)
Extract all the tags fromobj
into a tagconsumer
.- Parameters:
obj
- the object to extract the tags fromconsumer
- the consumer populated with the tags extracted from the object
-
-