Identifier class abstract
An identifier of something, represented as String, int or BigInt.
- Implemented types
Constructors
- Identifier()
-
Default
constconstructor to allow extending this abstract class.const - Identifier.from(Object id)
-
An identifier from
idthat MUST be eitherString,intorBigInt.factory - Identifier.fromBigInt(BigInt id)
-
An identifier from
idof the typeBigInt.factory - Identifier.fromInt(int id)
-
An identifier from
idof the typeint.factory - Identifier.fromString(String id)
-
An identifier from
idof the typeString.factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- isBigInt → bool
-
True if this value is stored as
BigInt.no setterinherited - isInt → bool
-
True if this value is stored as
int.no setterinherited - isInteger → bool
-
True if this value is stored as an integer (
intorBigInt) 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 -
Returns this value as a
BigIntvalue.inherited -
asInt(
) → int -
Returns this value as a
intvalue.inherited -
asString(
) → String -
Returns this value as a
Stringvalue.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? -
This value as a
BigIntvalue or null if cannot be converted toBigInt.inherited -
tryAsInt(
) → int? -
This value as a
intvalue or null if cannot be converted toint.inherited -
tryAsString(
) → String? -
This value as a
Stringvalue or null if cannot be converted toString.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
idOrNull(
Object? id) → Identifier? -
Prepares a nullable Identifier instance of the given
id