*
This commit is contained in:
parent
446dc9c568
commit
2448b2fe22
@ -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);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user