DwDataRequest<R> class sealed

A read. Its fields are its parameters — its complete filter — and its result type is expressed by the kind it extends:

Kind Result Default update
DwSingleRequest T (absent ⇒ dw.notFound) update
DwMaybeRequest T? matches ? upsert : remove
DwListRequest List<T> matches ? upsert : remove; .updateOnly(), .refetchOnUpdate()
DwPageRequest DwPageResult matches ? upsert : remove; .updateOnly()
DwTableRequest DwTablePage present → update; new or not matching → refetch
DwWindowRequest DwWindowResult matches ? upsert : remove

A request has no side effects: the client may retry it, cache its result under the request itself (equality is generated from the fields) and keep it live through channels.

acceptsItem, acceptsDeletion, matches, sort and channels must be pure functions of the object and the request's fields: the client relies on an equal request answering equally. DateTime.now() inside them is a bug.

Inheritance

Properties

channels → List<DwLiveChannel>
The channels whose updates this request's state absorbs while it is watched. Subscriptions are reference-counted across requests.
no setter
dwTypeName → String
The name this class travels under. Unique across the protocol.
no setterinherited
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

acceptsDeletion(DwDeletedObject deletion, DwWireProtocol protocol) → bool
Whether deletion removes an object of this request's item type.
acceptsItem(Object? item) → bool
Whether item is an instance of this request's item type.
decodeResult(Object? json, DwWireProtocol protocol) → R
Decodes a result of this call from the wire (client side). Throws FormatException when json is not a result of this call.
inherited
encodeResult(R result, DwWireProtocol protocol) → Object?
Encodes a result of this call for the wire (server side).
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
onUpdate(Object item) → DwUpdateAction
What an arrived object does to this request's state.
toJson() → Map<String, Object?>
The fields of this DTO as JSON. Absent optional fields are omitted — the wire carries nothing the receiver can do without.
inherited
toString() → String
A string representation of this object.
inherited

Operators

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