Mutable Entity
A mutable version of Entity that allows in-place modifications of the underlying map.
Unlike Entity, MutableEntity implements MutableDynoMap, enabling runtime modifications while still maintaining schema-bound type safety.
Example:
val person = MutableEntity(Person)
person[Person.name] = "Alex"
person[Person.age] = 30
// Or using put
person.put(Person.name, "Alex")Content copied to clipboard
Note: Mutations do not automatically trigger schema validation. Ensure all required fields are present before serialization or further processing.
See also
Mutable Dyno Map
Constructors
Link copied to clipboard
constructor(schema: S, other: <Error class: unknown class><SchemaProperty<S, *>>, readSafety: <Error class: unknown class> = other.unsafeCast<DynoMapImpl>().readSafety)
constructor(schema: S, data: MutableMap<Any, Any>?, json: Json?, readSafety: <Error class: unknown class> = DynoReadSafety.SYNCHRONIZED)