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

com.landawn.abacus.util.function.Callable Maven / Gradle / Ivy

There is a newer version: 1.2.9
Show newest version
package com.landawn.abacus.util.function;

import com.landawn.abacus.util.N;
import com.landawn.abacus.util.Try;

public interface Callable extends java.util.concurrent.Callable, Try.Callable {

    @Override
    R call();

    public static  Callable of(final Callable callable) {
        N.requireNonNull(callable);

        return callable;
    }

    public static Callable create(Runnable cmd) {
        N.requireNonNull(cmd);

        return new Callable() {
            @Override
            public Void call() {
                cmd.run();
                return null;
            }
        };
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy