Class ContextPairs.Pairs<T>
java.lang.Object
org.springframework.boot.logging.structured.ContextPairs.Pairs<T>
- Type Parameters:
T
- the item type
- Enclosing class:
- ContextPairs
Callback used to add pairs.
-
Method Summary
Modifier and TypeMethodDescription<V> void
add
(BiConsumer<T, BiConsumer<String, V>> pairs) Add pairs using the given callback.<E,
V> void add
(Function<T, Iterable<E>> elementsExtractor, Function<E, String> nameExtractor, Function<E, V> valueExtractor) Add pairs from an iterable.<E,
V> void add
(Function<T, Iterable<E>> elementsExtractor, JsonWriter.PairExtractor<E> pairExtractor) Add pairs from an iterable.<K,
V> void addMapEntries
(Function<T, Map<String, V>> extractor) Add pairs from map entries.
-
Method Details
-
addMapEntries
Add pairs from map entries.- Type Parameters:
K
- the map key typeV
- the map value type- Parameters:
extractor
- the extractor used to provide the map
-
add
public <E,V> void add(Function<T, Iterable<E>> elementsExtractor, JsonWriter.PairExtractor<E> pairExtractor) Add pairs from an iterable.- Type Parameters:
E
- the element typeV
- the value type- Parameters:
elementsExtractor
- the extractor used to provide the iterablepairExtractor
- the extractor used to provide the name and value
-
add
public <E,V> void add(Function<T, Iterable<E>> elementsExtractor, Function<E, String> nameExtractor, Function<E, V> valueExtractor) Add pairs from an iterable.- Type Parameters:
E
- the element typeV
- the value type- Parameters:
elementsExtractor
- the extractor used to provide the iterablenameExtractor
- the extractor used to provide the namevalueExtractor
- the extractor used to provide the value
-
add
Add pairs using the given callback.- Type Parameters:
V
- the value type- Parameters:
pairs
- callback provided with the item and consumer that can be called to actually add the pairs
-