Interface ThrowingOnlyIf<T extends ThrowingOnlyIf<T>>

All Superinterfaces:
Self<T>
All Known Implementing Classes:
AppConfiguration.AppConfigurationBuilder

public interface ThrowingOnlyIf<T extends ThrowingOnlyIf<T>> extends Self<T>
  • Method Summary

    Modifier and Type
    Method
    Description
    default <E extends Exception>
    T
    throwingOnlyIf(boolean statement, ThrowingConsumer<T,E> consumer)
    Executes the consumer only if the statement is true.

    Methods inherited from interface io.openems.edge.core.appmanager.Self

    self
  • Method Details

    • throwingOnlyIf

      default <E extends Exception> T throwingOnlyIf(boolean statement, ThrowingConsumer<T,E> consumer) throws E
      Executes 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 executed
      consumer - the consumer to execute if the statement is true
      Returns:
      this
      Throws:
      E - if the consumer throws the specified exception