NodeBluePrint<T> class
The blue print of a node
- key The key of the node
- initialProduct The initial product of the node
- documentation The documentation of the node
- suppliers A list of supplier pathes
- allowedProducts A list of allowed products
- produce The produce function
- smartMaster The smart master of this node
- productionTimeout Overrides the SCM's default production timeout for this node. Use a longer duration for asynchronous producers that should deliver their result in a single update instead of being finalized with the previous product when the default frame budget is exceeded.
- Implementers
Constructors
-
NodeBluePrint({required String key, required T initialProduct, String documentation = '', Iterable<
String> suppliers = const <String>[], List<T> allowedProducts = const [], Produce<T> ? produce, List<String> smartMaster = const [], bool canBeSmart = true, Duration? productionTimeout, T fromJson(Map<String, dynamic> json)?}) -
Constructor of the node
const
-
NodeBluePrint.map({required String supplier, required String toKey, required T initialProduct, T fromJson(Map<
String, dynamic> json)?}) -
Maps a supplier to a different key
factory
Properties
-
allowedProducts
→ List<
T> -
A list of allowed values
final
- canBeSmart → bool
-
If canBeSmart is set to false this node will not be a smart node,
also if it is placed within a smart scope
or if it has a smart master path set.
final
- documentation → String
-
The documentation of the node
final
- hashCode → int
-
The hash code for this object.
no setteroverride
- initialProduct → T
-
The initial product of the node
final
- isSmartNode → bool
-
Returns true if this node is a smart node, i.e. it has a smartMaster
no setter
- key → String
-
The key of this node
final
-
produce
→ Produce<
T> -
The produce function
final
- productionTimeout → Duration?
-
Overrides the SCM's default production timeout for this node.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
smartMaster
→ List<
String> -
If smartMaster is set this node will automatically connect to the
smartMaster and take over it's values once it is available.
no setter
-
suppliers
→ Iterable<
String> -
A list of supplier keys
final
Methods
-
castMap(
Map< String, dynamic> map) → T - Casts a map to a specific map type T
-
check(
) → void - Checks if the configuration is valid
-
connectSupplier(
String supplier) → NodeBluePrint< T> - Makes the node forwarding the value of the supplier
-
copyWith(
{T? initialProduct, String? key, Iterable< String> ? suppliers, Produce<T> ? produce, bool? canBeSmart, List<String> ? smartMaster, Duration? productionTimeout}) → NodeBluePrint<T> - Create a modified copy of the blue print
-
equals(
Object other) → bool - Provites an operator =
-
forwardTo(
String toKey) → NodeBluePrint< T> - Maps the key of the blue print to another key
-
fromJson(
dynamic value) → T - Converts json into the product
-
instantiate(
{required Scope scope, bool applyScBuilders = true, Owner< Node> ? owner}) → Node<T> - Instantiates the blue print in the given scope
-
instantiateAsInsert(
{required Node< T> host, Scope? scope, int? index}) → Insert<T> - Instantiates the blue print as insert in the given scope
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
T product) → dynamic - Converts the product into a json value
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
addJsonParser<
T> (FromJson< T> parseJson) → void - Set a json converter here to be able to convert json into the product
-
addJsonSerializer<
T> (ToJson< T> toJson) → void - Set a json converter here to be able to convert json into the product
-
addStringParser<
T> (FromString< T> parseString) → void - Set a string converter here to be able to convert json into the product
-
clearParsers(
) → void - Clears all json parsers. Useful for testing purposes.
-
example(
{String? key, Produce< int> ? produce}) → NodeBluePrint<int> - An example instance for test purposes
-
removeJsonParser<
T> () → void - Removes a json parser for the given type