Rule class
Represents a JSON rule. A rule is a set of conditions and actions that can be executed when the conditions are met.
A rule has the following properties:
- id: A unique identifier for the rule.
- name: A name for the rule.
- priority: A priority for the rule.
- enabled: A flag indicating whether the rule is enabled.
- conditions: A set of conditions that must be met for the rule to be executed.
- actionInfo: Information about the actions to be executed when the rule is activated.
A rule can have two types of actions:
onSuccess
: Actions to be executed when the rule is activated successfully.onFailure
: Actions to be executed when the rule is not activated successfully.
Constructors
- Rule.new({String? name = '', int priority = 0, bool enabled = true, required ConditionDefinition conditions, required ActionInfo actionInfo})
-
Rule.fromJson(Map<
String, dynamic> json) - Creates a Rule object from a JSON object.
Properties
- actionInfo → ActionInfo
-
Information about the actions to be executed when the rule is activated.
final
- conditions → ConditionDefinition
-
A set of conditions that must be met for the rule to be executed.
final
- enabled → bool
-
A flag indicating whether the rule is enabled.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- id → String
-
A unique identifier for the rule.
final
- name → String?
-
A name for the rule.
final
- priority → int
-
A priority for the rule.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Converts the Rule object to a JSON object.
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited