Interface Premise
public interface Premise
Result of a previously evaluated condition. Used to fluently chain API calls like
Optionals.ifPresent(). For example:
ifPresent(getStory(), Story::tell)
.or(() -> ifPresent(getJoke(), Joke::tell))
.orElse(() -> print("can't tell"));
- Since:
- 1.14
-
Method Summary
Modifier and TypeMethodDescriptionor(CheckedSupplier<? extends Premise, E> alternative) Evaluatesalternativeifthispremise doesn't hold.<E extends Throwable>
voidorElse(CheckedRunnable<E> block) Runsblockifthispremise doesn't hold.
-
Method Details
-
or
Evaluatesalternativeifthispremise doesn't hold.- Throws:
E
-
orElse
Runsblockifthispremise doesn't hold.- Throws:
E
-