Member
A member that contributes JSON. Typically, a member will contribute a single name/value pair based on an extracted value. They may also contribute more complex JSON structures when configured with one of the using(...)
methods.
The when(...)
methods may be used to filter a member (omit it entirely from the JSON). The as method can be used to adapt to a different type.
Parameters
<T>
the member type
Functions
Link copied to clipboard
open fun <E> usingExtractedPairs(elements: BiConsumer<T, Consumer<E>>, extractor: JsonWriter.PairExtractor<E>): JsonWriter.Member<T>
open fun <E, N, V> usingExtractedPairs(elements: BiConsumer<T, Consumer<E>>, nameExtractor: (E) -> N, valueExtractor: (E) -> V): JsonWriter.Member<T>
Add JSON name/value pairs by extracting values from a series of elements.
Link copied to clipboard
Add JSON based on further Members configuration.
Link copied to clipboard
Add JSON name/value pairs.
Link copied to clipboard
Only include this member when it is not
null
and has a toString() that is not zero length.Link copied to clipboard
Only include this member when it is not empty (See isEmpty for details).
Link copied to clipboard
Only include this member when its value is not
null
.Only include this member when an extracted value is not
null
.