ArgumentSerializers

class ArgumentSerializers<S>(map: Map<String, Serializer<*, S>>)

A {Argument -> Serializer} map, with helper functions to get the needed serializer as Serializer<Any?, S> rather than Serializer<*, S> and to serialize/deserialize all arguments.

Constructors

Link copied to clipboard
fun <S> ArgumentSerializers(map: Map<String, Serializer<*, S>>)

Functions

Link copied to clipboard
operator fun contains(argument: String): Boolean
Link copied to clipboard
fun deserializeAll(arguments: Map<String, S>): Map<String, Any?>

Deserialize all arguments, throwing MissingSerializerException if a serializer is missing.

Link copied to clipboard
fun <T> deserializeArgument(key: String, value: S): T

Deserialize an argument, throwing MissingSerializerException if the serializer is missing.

Link copied to clipboard
operator fun get(argument: String): Serializer<Any?, S>

Get a serializer for an argument as a Serializer<Any?, S>, throwing MissingSerializerException if a serializer is missing.

Link copied to clipboard
fun serializeAll(arguments: Map<String, *>): Map<String, S>

Serialize all arguments, throwing MissingSerializerException if a serializer is missing.

Link copied to clipboard
fun <T> serializeArgument(key: String, value: T): S

Serialize an argument, throwing MissingSerializerException if the serializer is missing.

Properties

Link copied to clipboard
val map: Map<String, Serializer<*, S>>

Sources

Link copied to clipboard