add

open fun add(name: String): JsonWriter.Member<T>

Add a new member with access to the instance being written.

Return

the added Member which may be configured further

Parameters

name

the member name


open fun <V> add(name: String, value: V): JsonWriter.Member<V>

Add a new member with a static value.

Return

the added Member which may be configured further

Parameters

<V>

the value type

name

the member name

value

the member value


open fun <V> add(name: String, supplier: Supplier<V>): JsonWriter.Member<V>

Add a new member with a supplied value.

Return

the added Member which may be configured further

Parameters

<V>

the value type

name

the member name

supplier

a supplier of the value


open fun <V> add(name: String, extractor: (T) -> V): JsonWriter.Member<V>

Add a new member with an extracted value.

Return

the added Member which may be configured further

Parameters

<V>

the value type

name

the member name

extractor

a function to extract the value


open fun add(): JsonWriter.Member<T>

Add a new member with access to the instance being written. The member is added without a name, so one of the Member.using(...) methods must be used to complete the configuration.

Return

the added Member which may be configured further