Interface Checked.ToShortFunction<T,​E extends Throwable>

  • Type Parameters:
    T - Type of the function's parameter.
    E - Exception type that can be thrown by the body.
    All Superinterfaces:
    Enclosing interface:
    Checked<WT,​EX extends Throwable>
    Functional Interface:
    This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

    public static interface Checked.ToShortFunction<T,​E extends Throwable>
    Represents a function that produces a short-valued result and can throw checked exceptions.
    • Method Detail

      • apply

        short apply​(T t)
             throws E extends Throwable
        Applies this function to the given argument.
        E extends Throwable
      • use

        static <T,​E extends ThrowableChecked.ToShortFunction<T,​E> use​(Checked.ToShortFunction<T,​E> o)
        Shapes a lambda or method reference into an instance of this functional interface.

        This is simply an identity function that can take the place of a more unwieldy cast.

        Type Parameters:
        E - Least upper bound of exception types o can throw.
        o - The implementing lambda or method reference.