All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.jooq.lambda.fi.util.function.CheckedLongToDoubleFunction Maven / Gradle / Ivy

Go to download

jOOλ is part of the jOOQ series (along with jOOQ, jOOX, jOOR, jOOU) providing some useful extensions to Java 8 lambdas.

There is a newer version: 0.9.15
Show newest version
/**
 * Copyright (c), Data Geekery GmbH, [email protected]
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 * 
 *     http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.jooq.lambda.fi.util.function;

import java.util.function.Consumer;
import java.util.function.LongToDoubleFunction;
import org.jooq.lambda.Sneaky;
import org.jooq.lambda.Unchecked;

/**
 * A {@link LongToDoubleFunction} that allows for checked exceptions.
 *
 * @author Lukas Eder
 */
@FunctionalInterface
public interface CheckedLongToDoubleFunction {

    /**
     * Applies this function to the given argument.
     *
     * @param value the function argument
     * @return the function result
     */
    double applyAsDouble(long value) throws Throwable;

    /**
     * @see {@link Sneaky#longToDoubleFunction(CheckedLongToDoubleFunction)}
     */
    static LongToDoubleFunction sneaky(CheckedLongToDoubleFunction function) {
        return Sneaky.longToDoubleFunction(function);
    }

    /**
     * @see {@link Unchecked#longToDoubleFunction(CheckedLongToDoubleFunction)}
     */
    static LongToDoubleFunction unchecked(CheckedLongToDoubleFunction function) {
        return Unchecked.longToDoubleFunction(function);
    }

    /**
     * @see {@link Unchecked#longToDoubleFunction(CheckedLongToDoubleFunction, Consumer)}
     */
    static LongToDoubleFunction unchecked(CheckedLongToDoubleFunction function, Consumer handler) {
        return Unchecked.longToDoubleFunction(function, handler);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy