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
Modifier and TypeMethodDescriptionstatic <T> TagExtractor<T> empty()Extract all the tags fromobjinto aMap<String, String>.default voidextractTo(T obj, BiConsumer<String, String> consumer) Extract all the tags fromobjinto a tagconsumer.default voidExtract all the tags fromobjinto thetagsmap.default intReturns the number of tagsobjexposes.default StringReturns the name of the tag extracted fromobjat the specifiedindex.default StringReturns the value of the tag extracted fromobjat the specifiedindex.
-
Method Details
-
empty
-
len
Returns the number of tagsobjexposes.- Parameters:
obj- the object to evaluate- Returns:
- the number of tags
-
name
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
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
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
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
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
-