Class OptionalConsumer<T>

  • Type Parameters:
    T - type of the optional

    public class OptionalConsumer<T>
    extends Object
    Utility class which allows to run code depending on whether the optional has a value or is empty.

    This code has been copied from: https://stackoverflow.com/a/29395324/4815083.