接口 JsonWriter.PairExtractor<E>
- 类型参数:
E
- the element type
- 封闭接口:
JsonWriter<T>
public static interface JsonWriter.PairExtractor<E>
Interface that can be used to extract name/value pairs from an element.
-
方法概要
修饰符和类型方法说明<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.
-
方法详细资料
-
getName
Extract the name.- 类型参数:
N
- the name type- 参数:
element
- the source element- 返回:
- the extracted name
-
getValue
Extract the name.- 类型参数:
V
- the value type- 参数:
element
- the source element- 返回:
- 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.- 类型参数:
T
- the element type- 参数:
nameExtractor
- the name extractorvalueExtractor
- the value extraction- 返回:
- a new
JsonWriter.PairExtractor
instance
-