ImmutableCrystallisData class abstract mixin

Immutable variant of CrystallisData. Used on generated data classes when Crystallise.mutable is false.

Implemented types

Constructors

ImmutableCrystallisData()

Properties

config Crystallise
Crystallise configuration
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
metadata Map<String, FieldMetadata>
Per-field metadata of this data class.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

assertSet<T>(String field, T value) → void
Asserts that the field can be set with the given value, and throws List<ValidationException> if any validators fail. Throws ArgumentError if the field does not exist or if the value is of the wrong type.
inherited
get(String field) Object?
Get the value of a field by name. To see what type it might be, check metadata.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serialize() Map<String, dynamic>
Serializes this object into a Map<String, dynamic>
inherited
set<T>(String field, T value) → void
Always throws an StateError since immutable data classes cannot be modified.
override
setFrom(CrystallisData other) → void
Always throws an StateError since immutable data classes cannot be modified.
override
toString() String
A string representation of this object.
inherited
tryGet<T>(String field) → T?
Try to get the value of a field by name, returning null if:
inherited
validate() Map<String, List<ValidationException>>
Validate all fields (including those with zero validators)
inherited
validateField(String field) List<ValidationException>
Validate a single field
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited