TranslatedSchema
class TranslatedSchema<T : Any, U : Any>(val baseSchema: FateSchema<U>, val toBase: (T) -> U) : FateSchema<T>
A schema that converts a T to a U and encodes the result with baseSchema.
It reports the same tag and schema bytes as baseSchema, so readers see a U.
Parameters
Properties
Functions
Link copied to clipboard
Writes the given object into the buffer.
Link copied to clipboard
Writes the whole schema definition, starting with the tag, into the buffer.
Link copied to clipboard
Returns the number of bytes encodeObject writes for the given object.