← back to roto on ba3a.dev

JsonCacheCodec

class JsonCacheCodec<T : Any>(serializer: KSerializer<T>) : CacheCodec<T>

A model, as value.json in the same canonical form every Roto JSON file has.

Constructors

Link copied to clipboard
constructor(serializer: KSerializer<T>)

Functions

Link copied to clipboard
open override fun read(entry: Path): T

Reads back what write stored in entry; throws an IOException when the content is not what it left.

Link copied to clipboard
open override fun write(value: T, entry: Path)

Stores value in entry, an empty folder.