CommandFactory<COMMAND extends Command<RESPONSE>, RESPONSE extends Object?> class

A factory containing a list of commands saved by types as their keys.

Constructors

CommandFactory(Map<Type, Builder<COMMAND>> builders)
const

Properties

builders Map<Type, Builder<COMMAND>>
Unmodifiable list of builders.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
isEmpty bool
Checks if the factory is empty.
no setterinherited
isNotEmpty bool
Checks if the factory is not empty.
no setterinherited
keys Iterable<Type>
Iterable of keys.
no setterinherited
length int
Number of builders in the factory.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

buildException(Type key) → BuilderNotFoundInFactoryException
CommandNotDefinedException overrides the default BuilderNotFoundInFactoryException
contains(Type key) bool
Checks if a builder is present in the factory.
inherited
createInstance(Type key, [Object? request]) → COMMAND
Finds and runs the builder to create an instance.
inherited
doesNotContain(Type key) bool
Checks if a builder is absent in the factory.
inherited
getBuilder(Type key) → Builder<COMMAND>
Returns a builder, when a key is provided.
inherited
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