@FunctionalInterface public interface Expectation<V>
Future.expecting(Expectation)
.Modifier and Type | Method and Description |
---|---|
default Expectation<V> |
and(Expectation<? super V> other)
Returned an expectation succeeding when this expectation and the
other expectation succeeds. |
default Throwable |
describe(V value)
Turn an invalid
value into an exception describing the failure, the default implementation returns a generic exception. |
default Expectation<V> |
or(Expectation<? super V> other)
Returned an expectation succeeding when this expectation or the
other expectation succeeds. |
boolean |
test(V value)
Check the
value , this should be side effect free, the expectation should either succeed returning true or fail
returning false . |
default Expectation<V> |
wrappingFailure(java.util.function.BiFunction<V,Throwable,Throwable> descriptor)
Returns a new expectation with the same predicate and a customized error
descriptor . |
boolean test(V value)
value
, this should be side effect free, the expectation should either succeed returning true
or fail
returning false
.value
- the checked valuedefault Expectation<V> and(Expectation<? super V> other)
other
expectation succeeds.other
- the other expectationother
default Expectation<V> or(Expectation<? super V> other)
other
expectation succeeds.other
- the other expectationother
default Throwable describe(V value)
value
into an exception describing the failure, the default implementation returns a generic exception.value
- the value to describedefault Expectation<V> wrappingFailure(java.util.function.BiFunction<V,Throwable,Throwable> descriptor)
descriptor
.descriptor
- the function describing the errordescriptor
Copyright © 2024 Eclipse. All rights reserved.