Value class abstract interface

An interface for a value with type and null safe accessors for data implementing Primitive.

Implementations should support accessing at least following types: String, int, BigInt, double, bool, DateTime, Identifier and Null.

Implemented types

Constructors

Value()

Properties

hashCode int
The hash code for this object.
no setterinherited
isBigInt bool
True if this value is stored as BigInt.
no setterinherited
isBool bool
True if this value is stored as a bool.
no setterinherited
isDateTime bool
True if this value is stored as a DateTime.
no setter
isDouble bool
True if this value is stored as a double.
no setterinherited
isId bool
True if this value is stored as a Identifier.
no setter
isInt bool
True if this value is stored as int.
no setterinherited
isInteger bool
True if this value is stored as an integer (int or BigInt) value.
no setterinherited
isNull bool
True if the stored value is a null object.
no setterinherited
isNumeric bool
True if this value is stored as numeric (int, BigInt, double) value.
no setterinherited
isString bool
True if this value is stored as a String.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

asBigInt({BigInt? min, BigInt? max}) BigInt
Returns this value as a BigInt value.
inherited
asBool() bool
This value as a bool value.
inherited
asDouble({double? min, double? max}) double
This value as a double value.
inherited
asId() Identifier
This value as a Identifier value.
asInt({int? min, int? max}) int
Returns this value as a int value.
inherited
asNum({num? min, num? max}) num
This value as a num value (either double or int).
inherited
asString() String
Returns this value as a String value.
inherited
asTimeUTC({DateTime parse(Object?)?}) DateTime
This value as a DateTime value in the UTC time zone.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
tryAsBigInt({BigInt? min, BigInt? max}) BigInt?
This value as a BigInt value or null if cannot be converted to BigInt.
inherited
tryAsBool() bool?
This value as a bool or null if cannot be converted to bool.
inherited
tryAsDouble({double? min, double? max}) double?
This value as a double or null if cannot be converted to double.
inherited
tryAsId() Identifier?
This value as a Identifier value or null if cannot be converted.
tryAsInt({int? min, int? max}) int?
This value as a int value or null if cannot be converted to int.
inherited
tryAsNum({num? min, num? max}) num?
This value as a num or null if cannot be converted to num.
inherited
tryAsString() String?
This value as a String value or null if cannot be converted to String.
inherited
tryAsTimeUTC({DateTime parse(Object?)?}) DateTime?
This value as a DateTime value (UTC) or null if cannot be converted.

Operators

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