com.github.phantomthief.util.MoreRunnables Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of more-lambdas Show documentation
Show all versions of more-lambdas Show documentation
Some useful lambda implements for Java 8.
package com.github.phantomthief.util;
import java.util.function.Supplier;
/**
* @author w.vela
*/
public final class MoreRunnables {
public static Runnable runOnce(Runnable runnable) {
return new Runnable() {
private final Supplier supplier = MoreSuppliers.lazy(() -> {
runnable.run();
return null;
});
@Override
public void run() {
supplier.get();
}
};
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy