This commit is contained in:
Jesse Boyd 2018-01-15 17:32:20 +11:00
parent 446dc9c568
commit 2448b2fe22
No known key found for this signature in database
GPG Key ID: 59F1DE6293AF6E1F

View File

@ -1,6 +1,9 @@
package com.boydti.fawe.object;
public abstract class RunnableVal<T> implements Runnable {
import java.util.function.Consumer;
import java.util.function.Supplier;
public abstract class RunnableVal<T> implements Runnable, Supplier<T>, Consumer<T> {
public T value;
public RunnableVal() {
@ -21,4 +24,14 @@ public abstract class RunnableVal<T> implements Runnable {
}
public abstract void run(T value);
@Override
public T get() {
return runAndGet();
}
@Override
public void accept(T t) {
run(value);
}
}