Package org.springframework.boot.json
Interface JsonWriter.PairExtractor<E>
- Type Parameters:
E
- the element type
- Enclosing interface:
- JsonWriter<T>
public static interface JsonWriter.PairExtractor<E>
Interface that can be used to extract name/value pairs from an element.
-
Method Summary
Modifier and TypeMethodDescription<N> N
Extract the name.<V> V
Extract the name.static <T> JsonWriter.PairExtractor<T>
Factory method to create aJsonWriter.PairExtractor
using distinct name and value extraction functions.
-
Method Details
-
getName
Extract the name.- Type Parameters:
N
- the name type- Parameters:
element
- the source element- Returns:
- the extracted name
-
getValue
Extract the name.- Type Parameters:
V
- the value type- Parameters:
element
- the source element- Returns:
- the extracted value
-
of
static <T> JsonWriter.PairExtractor<T> of(Function<T, ?> nameExtractor, Function<T, ?> valueExtractor) Factory method to create aJsonWriter.PairExtractor
using distinct name and value extraction functions.- Type Parameters:
T
- the element type- Parameters:
nameExtractor
- the name extractorvalueExtractor
- the value extraction- Returns:
- a new
JsonWriter.PairExtractor
instance
-