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

io.virtdata.functionadapters.ToLongUnaryOperator Maven / Gradle / Ivy

There is a newer version: 2.12.15
Show newest version
package io.virtdata.functionadapters;

import io.virtdata.annotations.ThreadSafeMapper;

import java.util.function.Function;
import java.util.function.LongFunction;
import java.util.function.LongUnaryOperator;

@ThreadSafeMapper
public class ToLongUnaryOperator implements LongUnaryOperator {

    private LongUnaryOperator operator;

    public ToLongUnaryOperator(LongFunction f) {
        this.operator = f::apply;
    }

    public ToLongUnaryOperator(Function f) {
        this.operator = f::apply;
    }

    public ToLongUnaryOperator(LongUnaryOperator f) {
        this.operator = f;
    }

    @Override
    public long applyAsLong(long operand) {
        return operator.applyAsLong(operand);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy