Deserializer

interface Deserializer<T>

Converts a textual representation in a given mimeType (e.g. JSON, YAML, XML) back into values of type T. This is the counterpart of Serializer, used e.g. to load a value that was previously persisted to disk or received over a network.

A typical implementation first parses the input string into a plain object tree using a format-specific reader (e.g. a Jackson ObjectMapper on the JVM), then converts that tree into a T via a Deobjectifier.

Type Parameters

T

the type of values this deserializer can produce.

See also

for the inverse operation.

Inheritors

Properties

Link copied to clipboard
abstract val mimeType: MimeType

The textual format this deserializer consumes.

Functions

Link copied to clipboard
abstract fun deserialize(string: String): T

Deserializes a single value of type T from its textual representation string.

Link copied to clipboard
abstract fun deserializeMany(string: String): Iterable<T>

Deserializes several values of type T from a single textual representation string of all of them.