Cascade
Loading...
Searching...
No Matches
Buzzware.Cascade.OpResponse Class Reference

Represents the response of an operation request in the Cascade library. This class encapsulates information about the operation's result, its connection status, elapsed time, and more. More...

Public Member Functions

 OpResponse (RequestOp requestOp, long timeMs, bool exists, long? arrivedAtMs, object? result, string? eTag=null)
 Constructs an instance of OpResponse with the given parameters.
OpResponse withChanges (RequestOp? requestOp=null, long? timeMs=null, bool? exists=null, long? arrivedAtMs=null, object? result=null, string? eTag=null)
 Creates a new OpResponse with updated fields if given, otherwise base fields remain the same.
bool ResultIsBlob ()
 Determines if the operation result is a binary large object (blob).
bool ResultIsEmpty ()
 Determines if the operation result is considered empty.
string ToSummaryString ()
 Produces a summary string of the result including connection and existence status.

Static Public Member Functions

static OpResponse None (RequestOp requestOp, long timeMs, string? sourceName=null)
 Constructs an OpResponse indicating that there was no value found.
static OpResponse ConnectionFailure (RequestOp requestOp, long timeMs, string sourceName=null)
 Constructs an OpResponse indicating a connection failure.

Public Attributes

readonly RequestOp RequestOp
readonly long TimeMs
readonly bool Exists
readonly? object Result
long? ArrivedAtMs
int LayerIndex
string? SourceName
readonly? string ETag

Properties

IReadOnlyList< object > Results [get]
 Provides an IEnumerable interface for the results.
object? FirstResult [get]
 Returns the first item in the results if they are enumerable, otherwise the result itself.
bool IsEnumerableResults [get]
 Indicates if the results are a collection that is not a blob.
bool IsModelResults [get]
 Indicates if the results are a model type.
bool IsIdResults [get]
 Indicates if the results are ids.
IEnumerable ResultIds [get]
 Provides an IEnumerable interface for the ids found in the results.

Detailed Description

Represents the response of an operation request in the Cascade library. This class encapsulates information about the operation's result, its connection status, elapsed time, and more.

Constructor & Destructor Documentation

◆ OpResponse()

Buzzware.Cascade.OpResponse.OpResponse ( RequestOp requestOp,
long timeMs,
bool exists,
long? arrivedAtMs,
object? result,
string? eTag = null )
inline

Constructs an instance of OpResponse with the given parameters.

Parameters
requestOpThe original request operation.
timeMsThe time in milliseconds when the operation took place.
existsIndicates if the item is present in the cache.
arrivedAtMsThe time in milliseconds when the response arrived.
resultThe result of the operation, can be null.
eTag

Member Function Documentation

◆ ConnectionFailure()

OpResponse Buzzware.Cascade.OpResponse.ConnectionFailure ( RequestOp requestOp,
long timeMs,
string sourceName = null )
inlinestatic

Constructs an OpResponse indicating a connection failure.

Parameters
requestOpThe original request operation.
timeMsTime when the operation attempt took place.
sourceNameThe name of the source that would have provided this response.
Returns
A new OpResponse indicating a connection failure.

◆ None()

OpResponse Buzzware.Cascade.OpResponse.None ( RequestOp requestOp,
long timeMs,
string? sourceName = null )
inlinestatic

Constructs an OpResponse indicating that there was no value found.

Parameters
requestOpThe original request operation.
timeMsTime when the operation took place.
sourceNameThe name of the source that provided this response.
Returns
A new OpResponse indicating no response was received.

◆ ResultIsBlob()

bool Buzzware.Cascade.OpResponse.ResultIsBlob ( )
inline

Determines if the operation result is a binary large object (blob).

Returns
True if the result is a blob.

◆ ResultIsEmpty()

bool Buzzware.Cascade.OpResponse.ResultIsEmpty ( )
inline

Determines if the operation result is considered empty.

Returns
True if the result is empty or null.

◆ ToSummaryString()

string Buzzware.Cascade.OpResponse.ToSummaryString ( )
inline

Produces a summary string of the result including connection and existence status.

Returns
A string summarizing the result, connection, and existence.

◆ withChanges()

OpResponse Buzzware.Cascade.OpResponse.withChanges ( RequestOp? requestOp = null,
long? timeMs = null,
bool? exists = null,
long? arrivedAtMs = null,
object? result = null,
string? eTag = null )
inline

Creates a new OpResponse with updated fields if given, otherwise base fields remain the same.

Parameters
requestOpUpdated request operation.
timeMsUpdated time in milliseconds.
existsUpdated existence status.
arrivedAtMsUpdated arrival time in milliseconds.
resultUpdated operation result.
eTag
Returns
The new OpResponse instance with specified changes.

The documentation for this class was generated from the following file:
  • Buzzware.Cascade/OpResponse.cs