
ru.progrm_jarvis.javacommons.util.function.DoubleBinaryOperator Maven / Gradle / Ivy
package ru.progrm_jarvis.javacommons.util.function;
import org.jetbrains.annotations.Contract;
import org.jetbrains.annotations.NotNull;
import java.util.function.BinaryOperator;
import java.util.function.UnaryOperator;
/**
* Represents an operation on a single {@code double} operand that produces a {@code double} result.
* This is the primitive type specialization of {@link UnaryOperator} for {@code double}.
*
* @see UnaryOperator non-primitive generic equivalent
*/
@FunctionalInterface
public interface DoubleBinaryOperator extends BinaryOperator<@NotNull Double>,
java.util.function.DoubleBinaryOperator {
@Override
@Contract("null, _ -> fail; _, null -> fail; _ -> _")
default @NotNull Double apply(final @NotNull Double left, final @NotNull Double right) {
// note: there is no need for explicit null-checkins as it will be done when unwrapping the values
return applyAsDouble(left, right);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy