Package-level declarations

Types

Link copied to clipboard
sealed class AbstractDynoSchema<M> : DynoSchema, KSerializer<M>
Link copied to clipboard

Builder for constructing a SimpleSchemaRegistry.

Link copied to clipboard

A builder class used to construct DynoMap or Entity instances with validation of required fields.

Link copied to clipboard
open class DynoMapSchema : AbstractDynoSchema<<Error class: unknown class><<Error class: unknown class><out <Error class: unknown class>>>>
Link copied to clipboard
interface DynoSchema

Interface for providing DynoKey instances by their string names.

Link copied to clipboard
sealed interface DynoSchemaRegistry
Link copied to clipboard
sealed class Entity<out S : DynoSchema>

Represents a type-safe wrapper over DynoMap that is bound to a specific DynoSchema.

Link copied to clipboard
abstract class EntitySchema(name: String, version: Int = 0, serializer: KSerializer<Entity<*>>? = null, readSafety: <Error class: unknown class> = DynoReadSafety.SYNCHRONIZED) : AbstractDynoSchema<Entity<*>>
Link copied to clipboard
class MutableEntity<out S : DynoSchema> : Entity<S>

A mutable version of Entity that allows in-place modifications of the underlying map.

Link copied to clipboard
Link copied to clipboard

Marker interface indicating the EntitySchema is polymorphic base. The marker is useless if schema is not EntitySchema.

Link copied to clipboard
abstract class PolymorphicDynoSerializer<T : Entity<*>>(baseSchemaName: String, baseSchemaVersion: Int = -1, unknownKeysStrategy: UnknownKeysStrategy = DEFAULT_UNKNOWN_KEY_STRATEGY, registry: PolymorhicSchemaRegistry? = null, discriminator: String = DEFAULT_DISCRIMINATOR)
Link copied to clipboard
data class SchemaProperty<in S : DynoSchema, T> : Comparable<<Error class: unknown class><T>>

A basic implementation of DynoKey. Similar to SimpleDynoKey but bound to specific DynoSchema (sub)type S.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Registry holding a mapping from schema IDs to DynoSchemas.

Functions

Link copied to clipboard

Returns a new DynoSchema that includes all properties from both the original schema and the other schema. If there are conflicting property names between the two schemas, an exception is thrown.

Link copied to clipboard
fun SerializersModuleBuilder.dynoSchemaRegistry(registry: DynoSchemaRegistry)

Registers a SimpleSchemaRegistry into the current kotlinx.serialization.modules.SerializersModuleBuilder.

fun SerializersModuleBuilder.dynoSchemaRegistry(build: SchemaRegistryBuilder.() -> Unit)

Registers a SimpleSchemaRegistry built via SchemaRegistryBuilder DSL into the current SerializersModuleBuilder.

Link copied to clipboard
inline fun <S : AbstractDynoSchema<out <Error class: unknown class><K>>, K> S.new(capacity: Int = keyCount(), body: DynoMapBuilder<S>.(S) -> Unit): <Error class: unknown class><K>

Creates a new DynoMap instance using the schema's structure and enforces validation of required fields.

inline fun <S : EntitySchema> S.new(capacity: Int = keyCount(), body: DynoMapBuilder<S>.(S) -> Unit): Entity<S>

Creates a new Entity instance using the schema's structure and enforces validation of required fields.

Link copied to clipboard
inline fun <S : AbstractDynoSchema<<Error class: unknown class><K>>, K> S.newUnsafe(capacity: Int = keyCount(), body: <Error class: unknown class><K>.(S) -> Unit): <Error class: unknown class><K>
inline fun <S : EntitySchema> S.newUnsafe(capacity: Int = keyCount(), body: MutableEntity<S>.(S) -> Unit): Entity<S>
Link copied to clipboard
inline fun <S : DynoSchema, R : Any> Entity<S>.select(body: Selector<S, R>.() -> Unit): R

Executes a selection logic over the schema of this Entity, allowing to define multiple conditional branches based on the actual schema type and providing a fallback via Selector.orElse.

Link copied to clipboard
infix fun <S : AbstractDynoSchema<*>, K : SchemaProperty<S, in T>, T> K.set(value: T?)
infix fun <S : DynoSchema, T> SchemaProperty<S, in T>.set(value: T)