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 fromobjinto aMap<String, String>.default voidextractTo(T obj, BiConsumer<String,String> consumer)Extract all the tags fromobjinto a tagconsumer.default voidextractTo(T obj, Map<String,String> tags)Extract all the tags fromobjinto thetagsmap.default intlen(T obj)Returns the number of tagsobjexposes.default Stringname(T obj, int index)Returns the name of the tag extracted fromobjat the specifiedindex.default Stringvalue(T obj, int index)Returns the value of the tag extracted fromobjat the specifiedindex.
-
-
-
Method Detail
-
empty
static <T> TagExtractor<T> empty()
-
len
default int len(T obj)
Returns the number of tagsobjexposes.- 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 fromobjat 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 fromobjat 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 fromobjinto 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 fromobjinto thetagsmap.- 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 fromobjinto a tagconsumer.- Parameters:
obj- the object to extract the tags fromconsumer- the consumer populated with the tags extracted from the object
-
-