A interface for a primitive value with type and null safe accessors for data.
Implementations should support accessing at least following types: String
,
int
, BigInt
, double
, bool
and Null
.
- Implemented types
- Implementers
Constructors
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 setter - isDouble → bool
-
True if this value is stored as a
double
.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
orBigInt
) value.no setterinherited - isNull → bool
-
True if the stored value is a
null
object.no setter - isNumeric → bool
-
True if this value is stored as numeric (
int
,BigInt
,double
) value.no setter - 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.override -
asBool(
) → bool -
This value as a
bool
value. -
asDouble(
{double? min, double? max}) → double -
This value as a
double
value. -
asInt(
{int? min, int? max}) → int -
Returns this value as a
int
value.override -
asNum(
{num? min, num? max}) → num -
This value as a
num
value (eitherdouble
orint
). -
asString(
) → String -
Returns this value as a
String
value.inherited -
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 toBigInt
.override -
tryAsBool(
) → bool? -
This value as a
bool
or null if cannot be converted tobool
. -
tryAsDouble(
{double? min, double? max}) → double? -
This value as a
double
or null if cannot be converted todouble
. -
tryAsInt(
{int? min, int? max}) → int? -
This value as a
int
value or null if cannot be converted toint
.override -
tryAsNum(
{num? min, num? max}) → num? -
This value as a
num
or null if cannot be converted tonum
. -
tryAsString(
) → String? -
This value as a
String
value or null if cannot be converted toString
.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited