
com.machinezoo.noexception.throwing.ThrowingDoubleUnaryOperator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of noexception Show documentation
Show all versions of noexception Show documentation
Makes exception handling concise and beautiful, yet architecturally clean and flexible.
// Part of NoException: https://noexception.machinezoo.com
package com.machinezoo.noexception.throwing;
import java.util.function.*;
import com.machinezoo.noexception.*;
/**
* Variation of {@link DoubleUnaryOperator} that allows throwing checked exceptions.
* {@code ThrowingDoubleUnaryOperator} is usually implemented by a lambda
* and passed to {@link CheckedExceptionHandler#fromDoubleUnaryOperator(ThrowingDoubleUnaryOperator)}.
* See noexception tutorial.
*
* @see CheckedExceptionHandler#fromDoubleUnaryOperator(ThrowingDoubleUnaryOperator)
* @see DoubleUnaryOperator
*/
@FunctionalInterface public interface ThrowingDoubleUnaryOperator {
/**
* Variation of {@link DoubleUnaryOperator#applyAsDouble(double)} that allows throwing checked exceptions.
*
* @param operand
* see {@link DoubleUnaryOperator#applyAsDouble(double)}
* @return see {@link DoubleUnaryOperator#applyAsDouble(double)}
* @throws Exception
* if unable to complete
* @see CheckedExceptionHandler#fromDoubleUnaryOperator(ThrowingDoubleUnaryOperator)
* @see DoubleUnaryOperator#applyAsDouble(double)
*/
double applyAsDouble(double operand) throws Exception;
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy