ICleanable class

Interface for components that should clean their state.

Cleaning state most often is used during testing. But there may be situations when it can be done in production.

See Cleaner

Example

class MyObjectWithState implements ICleanable {
    dynamic _state = {};
    ...
    Future clear(String correlationId) {
       this._state = {};
       return new Future();
    }
}

Constructors

ICleanable()

Properties

hashCode → int
The hash code for this object. [...]
read-only, inherited
runtimeType → Type
A representation of the runtime type of the object.
read-only, inherited

Methods

clear(String correlationId) → Future
  • Clears component state.
      • correlationId (optional) transaction id to trace execution through call chain.
    • Return Future that receives error or null no errors occured.
  • noSuchMethod(Invocation invocation) → dynamic
    Invoked when a non-existent method or property is accessed. [...]
    inherited
    toString() → String
    Returns a string representation of this object.
    inherited

    Operators

    operator ==(dynamic other) → bool
    The equality operator. [...]
    inherited