PatchOperation class

A single patch operation (RFC 6902 JSON Patch).

Constructors

PatchOperation({required PatchOperationType type, required String path, dynamic value, String? from})
Creates a PatchOperation.
const
PatchOperation.add(String path, dynamic value)
Creates an add operation.
factory
PatchOperation.copy(String from, String path)
Creates a copy operation.
factory
PatchOperation.fromJson(Map<String, dynamic> json)
Creates a PatchOperation from RFC 6902 JSON format.
factory
PatchOperation.move(String from, String path)
Creates a move operation.
factory
PatchOperation.remove(String path)
Creates a remove operation.
factory
PatchOperation.replace(String path, dynamic value)
Creates a replace operation.
factory
PatchOperation.test(String path, dynamic value)
Creates a test operation.
factory

Properties

from → String?
The source path for move and copy operations.
final
hashCode → int
The hash code for this object.
no setterinherited
path → String
The JSON Pointer path (e.g., '/name', '/items/0').
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
type → PatchOperationType
The type of operation.
final
value → dynamic
The value for add, replace, copy, and test operations.
final

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Map<String, dynamic>
Converts the operation to RFC 6902 JSON format.
toString() → String
A string representation of this object.
override

Operators

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