The mechanical store behind a registry: id codes per id type, plus counters.
Every method answers with a value — trouble comes back as a Left, never as
a throw — so adapters can be swapped without changing error handling, and
the counters exist so generated ids do not have to re-scan the whole store.
- Implementers
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
add(
{required String idType, required String idCode}) → Future< Either< IdStorageFailure, Unit> > -
Records
idCodeunderidType, keeping whatever is already stored. -
clear(
) → Future< Either< IdStorageFailure, Unit> > - Drops every code and every counter.
-
codesFor(
{required String idType}) → Future< Either< IdStorageFailure, Set< >String> > -
Every code stored under
idType. -
contains(
{required String idType, required String idCode}) → Future< Either< IdStorageFailure, bool> > -
Whether
idCodeis stored underidType. -
counterFor(
{required String idType}) → Future< Either< IdStorageFailure, int> > -
The counter stored for
idType, or 0 when none was ever set. -
idTypes(
) → Future< Either< IdStorageFailure, Set< >String> > - Every id type holding at least one code.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
remove(
{required String idType, required String idCode}) → Future< Either< IdStorageFailure, Unit> > -
Removes
idCodefromidType; removing an absent code is a success. -
setCounter(
{required String idType, required int value}) → Future< Either< IdStorageFailure, Unit> > -
Stores
valueas the counter foridType. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited