Package net.jqwik.api.lifecycle
Interface TryExecutionResult
-
@API(status=EXPERIMENTAL, since="1.2.3") public interface TryExecutionResult
Represents the result of calling a property method with a list of parameters.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TryExecutionResult.Status
Status of running a single try.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description static TryExecutionResult
falsified(java.lang.Throwable throwable)
Create a result that falsified the current property and will immediately finish this property as failed.static TryExecutionResult
invalid()
Create a result that calls out the current parameter list as invalid.static TryExecutionResult
invalid(java.lang.Throwable throwable)
Create a result that calls out the current parameter list as invalid.default boolean
isFalsified()
default boolean
isInvalid()
default boolean
isSatisfied()
static TryExecutionResult
satisfied()
Create a result that satisfies the current property with the current parameter set.static TryExecutionResult
satisfied(boolean shouldPropertyFinishEarly)
Create a result that satisfies the current property and will immediately finish this property as successful.boolean
shouldPropertyFinishEarly()
TryExecutionResult.Status
status()
java.util.Optional<java.lang.Throwable>
throwable()
Will returnOptional.empty()
if status is anything but TryExecutionResult.Status.FALSIFIED.
-
-
-
Method Detail
-
satisfied
static TryExecutionResult satisfied()
Create a result that satisfies the current property with the current parameter set. All remaining tries to be executed.- Returns:
- result instance
-
satisfied
static TryExecutionResult satisfied(boolean shouldPropertyFinishEarly)
Create a result that satisfies the current property and will immediately finish this property as successful.- Returns:
- result instance
-
falsified
static TryExecutionResult falsified(java.lang.Throwable throwable)
Create a result that falsified the current property and will immediately finish this property as failed.- Parameters:
throwable
- The throwable to describe the reason of falsification- Returns:
- result instance
-
invalid
@API(status=EXPERIMENTAL, since="1.3.7") static TryExecutionResult invalid(java.lang.Throwable throwable)
Create a result that calls out the current parameter list as invalid. All remaining tries will be executed.- Parameters:
throwable
- A (potentially null) exception. Usually of type TestAbortedException.- Returns:
- result instance
-
invalid
static TryExecutionResult invalid()
Create a result that calls out the current parameter list as invalid. All remaining tries will be executed.- Returns:
- result instance
-
isSatisfied
default boolean isSatisfied()
- Returns:
- true if status is satisfied
-
isFalsified
@API(status=EXPERIMENTAL, since="1.3.3") default boolean isFalsified()
- Returns:
- true if status is falsified
-
isInvalid
@API(status=EXPERIMENTAL, since="1.3.3") default boolean isInvalid()
- Returns:
- true if status is invalid
-
status
TryExecutionResult.Status status()
- Returns:
- Status enum
-
throwable
java.util.Optional<java.lang.Throwable> throwable()
Will returnOptional.empty()
if status is anything but TryExecutionResult.Status.FALSIFIED.- Returns:
- instance of Throwable or subtype
-
shouldPropertyFinishEarly
boolean shouldPropertyFinishEarly()
- Returns:
- true if status is satisfied and remaining tries shall be skipped
-
-