com.landawn.abacus.util.function.Callable Maven / Gradle / Ivy
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();
/**
* Returns the specified instance
*
* @param callable
* @return
*/
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