org.echocat.jsu.Generator Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-stream-utils Show documentation
Show all versions of java-stream-utils Show documentation
Utilities to handle Java Streams.
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;
}
}
}