ZorphyPatchWire class abstract final

The field-level decode primitives a generated patch fromWire calls.

Every member is total: a value of the wrong shape appends a FieldViolation and answers null, never a thrown cast.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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

Static Methods

as<T>(Object? value, String path, List<FieldViolation> violations, {bool nullable = false}) → T?
value as a T, or a violation at path.
asDateTime(Object? value, String path, List<FieldViolation> violations) → DateTime?
value as a DateTime, accepting an ISO-8601 string.
asDouble(Object? value, String path, List<FieldViolation> violations) → double?
value as a double, accepting a JSON integer (1 is a legal 1.0).
asNum(Object? value, String path, List<FieldViolation> violations) → num?
value as a num, preserving an integer rather than rounding it.
asObject(Object? value, String path, List<FieldViolation> violations) → Map<String, Object?>?
value as a Map<String, Object?>.
describe(Object? value) → String
A short, bounded description of value for a violation's actual.
entityTypeOf(Map<String, Object?> raw) → String?
The entityType raw carries, or null when it carries no envelope.
enumByName<E extends Enum>(List<E> values, Object? value, String path, List<FieldViolation> violations) → E?
value as one of values, matched by NAME rather than by index.
fieldValue(Object? value, String path, List<FieldViolation> violations) → Object?
One field's value, unwrapping the explicit-set spelling a peer may send in place of the bare value (toWire() writes the bare value, so both are accepted).
listDelta<E>(Object? raw, String path, List<FieldViolation> violations, E? decodeElement(Object? value, String path, List<FieldViolation> violations)) → ListPatchDelta<E>?
The delta raw carries for a list field, or null when it could not be decoded in full.
listValue<E>(Object? raw, String path, List<FieldViolation> violations, E? decodeElement(Object? value, String path, List<FieldViolation> violations)) → List<E>?
The atomic list raw carries for a list field, or null when it could not be decoded in full (zorphy#248).
mapDelta<K, V>(Object? raw, String path, List<FieldViolation> violations, {required K? decodeKey(Object? value, String path, List<FieldViolation> violations), required V? decodeValue(Object? value, String path, List<FieldViolation> violations)}) → MapPatchDelta<K, V>?
The delta raw carries for a map field, or null when it could not be decoded in full.
mapValue<K, V>(Object? raw, String path, List<FieldViolation> violations, {required K? decodeKey(Object? value, String path, List<FieldViolation> violations), required V? decodeValue(Object? value, String path, List<FieldViolation> violations)}) → Map<K, V>?
The atomic map raw carries for a map field, or null when it could not be decoded in full.
opsOf(Map<String, Object?> raw, String path, List<FieldViolation> violations) → Map<String, Object?>?
The patch ops raw carries, whether raw is an envelope or a bare toWire() map.
opsPathOf(Map<String, Object?> raw) → String
The path prefix a field read sits under: /ops for an envelope, empty for a bare toWire() map.
patchKindOf(Map<String, Object?> raw) → String?
The patchKind raw carries, or null when it carries no envelope.
pointerToken(Object? key) → String
Escapes key as one RFC 6901 JSON Pointer token.
prefix(List<FieldViolation> violations, String path) → List<FieldViolation>
Re-paths violations under path, for a nested decode's result.
principalKeyOf(Map<String, Object?> raw) → Object?
The principalKey raw carries, if any.
requireMember(Map<String, Object?> map, String key, String path, List<FieldViolation> violations) → bool
Declares that key must be present in map, reporting a violation at <path>/<key> when it is absent.
stringKey(Object? value, String path, List<FieldViolation> violations) → String?
A String map key — the JSON spelling every key arrives as.

Constants

entityTypeKey → const String
The envelope key naming the entity (or hierarchy root) type.
opsKey → const String
The envelope key carrying the patch's own toWire() map.
patchKindKey → const String
The envelope key naming which patch class the ops belong to.
principalKeyKey → const String
The envelope key carrying the principal key of the row being patched.
reservedEnvelopeKeys → const Set<String>
The names an envelope reserves: a generated patch field may not use one.
sharedPatchKind → const String
The patchKind a hierarchy's shared patch answers to.