Interface SideEffect

Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface public interface SideEffect

Represent a computation with an interesting side effect.

This is very similar to Runnable, but the latter is historically often associated with operations meant to be ran in a separate Thread for concurrency purposes. To avoid confusion with this association, the SideEffect interface is meant to represent what's essentially a Function<Void, Void> whose side effect is interesting.

  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Call the side effect.
  • Method Details

    • call

      void call()
      Call the side effect.