Identifier class abstract

An identifier of something, represented as String, int or BigInt.

Implemented types

Constructors

Identifier()
Default const constructor to allow extending this abstract class.
const
Identifier.from(Object id)
An identifier from id that MUST be either String, int or BigInt.
factory
Identifier.fromBigInt(BigInt id)
An identifier from id of the type BigInt.
factory
Identifier.fromInt(int id)
An identifier from id of the type int.
factory
Identifier.fromString(String id)
An identifier from id of the type String.
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 (int or BigInt) 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 BigInt value.
inherited
asInt() int
Returns this value as a int value.
inherited
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?
This value as a BigInt value or null if cannot be converted to BigInt.
inherited
tryAsInt() int?
This value as a int value or null if cannot be converted to int.
inherited
tryAsString() String?
This value as a String value or null if cannot be converted to String.
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