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

com.link_intersystems.util.function.BiFunctionRunnable Maven / Gradle / Ivy

package com.link_intersystems.util.function;

import java.util.function.BiFunction;

/**
 * Adapts a {@link BiFunction} to a {@link Runnable}.
 *
 * @param 
 * @param 
 * @param 
 */
public class BiFunctionRunnable implements Runnable {

    private R result;
    private BiFunction function;
    private T argument1;
    private U argument2;

    public BiFunctionRunnable(BiFunction function, T argument1, U argument2) {
        this.function = function;
        this.argument1 = argument1;
        this.argument2 = argument2;
    }

    @Override
    public void run() {
        result = function.apply(argument1, argument2);
    }

    public R getResult() {
        return result;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy