Package io.openems.edge.core.appmanager
Interface ThrowingOnlyIf<T extends ThrowingOnlyIf<T>>
- All Superinterfaces:
Self<T>
- All Known Implementing Classes:
AppConfiguration.AppConfigurationBuilder
-
Method Summary
Modifier and TypeMethodDescriptionthrowingOnlyIf
(boolean statement, ThrowingConsumer<T, E> consumer) Executes the consumer only if the statement is true.
-
Method Details
-
throwingOnlyIf
default <E extends Exception> T throwingOnlyIf(boolean statement, ThrowingConsumer<T, E> consumer) throws EExecutes the consumer only if the statement is true.- Type Parameters:
E
- the type of the exception- Parameters:
statement
- the statement to determine if the consumer should get executedconsumer
- the consumer to execute if the statement is true- Returns:
- this
- Throws:
E
- if the consumer throws the specified exception
-