IdGenerator class
Short unique id generator
Constructors
- IdGenerator({int workerId = 0, DateTime? refDate})
-
Use
refDate
to configure reference date to compute time part of the id. Use workerId to maintain uniqueness when concurrent generators are used.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- refDate → DateTime
-
Reference date used for generation of time part of the id.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- workerId → int
-
Worker id. This should be unique across concurrent generators intended to
generate unique ids for same target.
final
Methods
-
generate(
) → String -
generateReadable(
{String separator = '-'}) → String -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited