PreconditionStatus class
Result of precondition check. Your precondition function should return one of two possible results:
PreconditionStatus.satisfied([Object data])
// check finished OK (and possible additional details)
PreconditionStatus.failed([Object data])
// check DIDN'T finished OK (and possible additional details)
There are few other possible statuses, but those are assigned automatically during the check and you are not supposed to use them as your return value. When reading the result state use convenient is-something methods: isSatisfied, isFailed, isFailed (test threw an exception), isUnknown (test wasn't run yet), isNotSatisfied (which means - anything else then satisfied).
Constructors
- PreconditionStatus.failed([Object? data])
- Test DIDN'T finished OK (and possible additional details). Return it as the result of your PreconditionFunction.
- PreconditionStatus.fromBoolean(bool result, [Object? data])
-
Often you have a boolean value in your hands - use this constructor to create either
PreconditionStatus.satisfied() (true) or
PreconditionStatus.Failed()
(false).factory - PreconditionStatus.satisfied([Object? data])
- Test finished OK (and possible additional details). Return it as the result of your PreconditionFunction.
Properties
- data → Object?
-
Addition data about the result, use anyway you need.
final
- exception → Object?
-
Possible exception when "failed"
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isFailed → bool
-
Convenient discriminator.
no setter
- isNotSatisfied → bool
-
Convenient discriminator. Please note, that it's not the same as 'isFailed'.
no setter
- isSatisfied → bool
-
Convenient discriminator.
no setter
- isUnknown → bool
-
Convenient discriminator.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- stackTrace → StackTrace?
-
Possible exception's stack trace when "failed"
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited