org.echocat.jsu.Generator Maven / Gradle / Ivy
package org.echocat.jsu;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.function.Supplier;
@FunctionalInterface
public interface Generator {
@Nullable
Value generate();
@FunctionalInterface
public interface Value extends Supplier {
@Nonnull
public static Value valueOf(@Nullable T value) {
return () -> value;
}
@Nullable
public static Value end() {
return null;
}
}
}