RespType<P> class abstract

Base class for all RESP types.

Implementers

Properties

hashCode int
The hash code for this object.
no setterinherited
isArray bool
Return true if this type is an array.
no setter
isBulkString bool
Return true if this type is a bulk string.
no setter
isError bool
Return true if this type is an error.
no setter
isInteger bool
Return true if this type is an integer.
no setter
isSimpleString bool
Return true if this type is a simple string.
no setter
payload → P
final
prefix String
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
typeName String
The name of the concrete type.
no setter

Methods

handleAs<T>({T simple(RespSimpleString)?, T bulk(RespBulkString)?, T integer(RespInteger)?, T array(RespArray)?, T error(RespError)?}) → T
Calls one of the given handlers based on the concrete type. Returns true if a handler for the concrete type was provided, otherwise false is returned. If the handler throws an error while executing, the error is raised to the caller of this method.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
serialize() List<int>
Serializes this type to RESP.
toArray() RespArray
Converts this type to an array. Throws a StateError if this is not an array.
toBulkString() RespBulkString
Converts this type to a bulk string. Throws a StateError if this is not a bulk string.
toError() RespError
Converts this type to an error. Throws a StateError if this is not an error.
toInteger() RespInteger
Converts this type to an integer. Throws a StateError if this is not an integer.
toSimpleString() RespSimpleString
Converts this type to a simple string. Throws a StateError if this is not a simple string.
toString() String
A string representation of this object.
override

Operators

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