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? -
valueas aT, or a violation atpath. -
asDateTime(
Object? value, String path, List< FieldViolation> violations) → DateTime? -
valueas a DateTime, accepting an ISO-8601 string. -
asDouble(
Object? value, String path, List< FieldViolation> violations) → double? -
valueas adouble, accepting a JSON integer (1is a legal1.0). -
asNum(
Object? value, String path, List< FieldViolation> violations) → num? -
valueas a num, preserving an integer rather than rounding it. -
asObject(
Object? value, String path, List< FieldViolation> violations) → Map<String, Object?> ? -
valueas aMap<String, Object?>. -
describe(
Object? value) → String -
A short, bounded description of
valuefor a violation'sactual. -
entityTypeOf(
Map< String, Object?> raw) → String? -
The
entityTyperawcarries, ornullwhen it carries no envelope. -
enumByName<
E extends Enum> (List< E> values, Object? value, String path, List<FieldViolation> violations) → E? -
valueas one ofvalues, 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
rawcarries for a list field, ornullwhen 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
rawcarries for a list field, ornullwhen 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
rawcarries for a map field, ornullwhen 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
rawcarries for a map field, ornullwhen it could not be decoded in full. -
opsOf(
Map< String, Object?> raw, String path, List<FieldViolation> violations) → Map<String, Object?> ? -
The patch ops
rawcarries, whetherrawis an envelope or a baretoWire()map. -
opsPathOf(
Map< String, Object?> raw) → String -
The path prefix a field read sits under:
/opsfor an envelope, empty for a baretoWire()map. -
patchKindOf(
Map< String, Object?> raw) → String? -
The
patchKindrawcarries, ornullwhen it carries no envelope. -
pointerToken(
Object? key) → String -
Escapes
keyas one RFC 6901 JSON Pointer token. -
prefix(
List< FieldViolation> violations, String path) → List<FieldViolation> -
Re-paths
violationsunderpath, for a nested decode's result. -
principalKeyOf(
Map< String, Object?> raw) → Object? -
The
principalKeyrawcarries, if any. -
requireMember(
Map< String, Object?> map, String key, String path, List<FieldViolation> violations) → bool -
Declares that
keymust be present inmap, reporting a violation at<path>/<key>when it is absent. -
stringKey(
Object? value, String path, List< FieldViolation> violations) → String? -
A
Stringmap 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.
-
The
patchKinda hierarchy's shared patch answers to.