Objectifier

interface Objectifier<T>

Converts values of type T into plain, format-agnostic objects (e.g. maps, lists, strings, numbers, booleans) that a generic data-binding library (such as Jackson on the JVM) can then turn into JSON, YAML, XML, or any other concrete textual representation.

This is the intermediate step a Serializer relies on: it first objectifies a value with an Objectifier, then hands the resulting plain object to a format-specific writer. Splitting the two steps means the very same object model can be rendered in any supported MimeType without duplicating the conversion logic for each format.

Type Parameters

T

the type of values this objectifier can convert.

See also

for the inverse conversion.

Inheritors

Functions

Link copied to clipboard
abstract fun objectify(value: T): Any

Converts a single value into a plain object.

Link copied to clipboard
abstract fun objectifyMany(values: Iterable<T>): Any
open fun objectifyMany(values: Sequence<T>): Any
open fun objectifyMany(vararg values: T): Any

Converts several values into a single plain object representing all of them.