rd-framework / com.jetbrains.rd.framework / UniversalMarshaller

UniversalMarshaller

open class UniversalMarshaller<T : Any> : IMarshaller<T>

Constructors

<init>

UniversalMarshaller(_type: KClass<*>, reader: (SerializationCtx, AbstractBuffer) -> T, writer: (SerializationCtx, AbstractBuffer, T) -> Unit, predefinedId: Int? = null)

Properties

_type

open val _type: KClass<*>

id

open val id: RdId

predefinedId

val predefinedId: Int?

reader

val reader: (SerializationCtx, AbstractBuffer) -> T

writer

val writer: (SerializationCtx, AbstractBuffer, T) -> Unit

Functions

read

open fun read(ctx: SerializationCtx, buffer: AbstractBuffer): T

write

open fun write(ctx: SerializationCtx, buffer: AbstractBuffer, value: T): Unit

Extension Functions

array

fun <T> ISerializer<T>.array(): ISerializer<Array<T>>

deepClonePolymorphic

fun <T> T.deepClonePolymorphic(): T

interned

fun <T : Any> ISerializer<T>.interned(internKey: String): ISerializer<T>

list

fun <T> ISerializer<T>.list(): ISerializer<List<T>>

nullable

fun <T : Any> ISerializer<T>.nullable(): ISerializer<T?>

Inheritors

DelegatedMarshaller

open class DelegatedMarshaller<TFrom : Any, TTo : Any> : UniversalMarshaller<TTo>