PairExtractor

interface PairExtractor<E>

Interface that can be used to extract name/value pairs from an element.

Parameters

<E>

the element type

Functions

Link copied to clipboard
abstract fun <N> getName(element: E): N
Extract the name.
Link copied to clipboard
abstract fun <V> getValue(element: E): V
Extract the name.
Link copied to clipboard
open fun <T> of(nameExtractor: (T) -> out Any, valueExtractor: (T) -> out Any): JsonWriter.PairExtractor<T>
Factory method to create a PairExtractor using distinct name and value extraction functions.