functionalj.stream.StreamPlusHelper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of functionalj-core Show documentation
Show all versions of functionalj-core Show documentation
The module for FunctionalJ Core.
package functionalj.stream;
import java.util.Iterator;
import java.util.concurrent.atomic.AtomicReference;
import java.util.function.BiFunction;
import java.util.function.Consumer;
import java.util.function.Function;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;
import lombok.val;
public class StreamPlusHelper {
static final Object dummy = new Object();
public static boolean hasAt(Stream stream, long index) {
return hasAt(stream, index, null);
}
public static boolean hasAt(Stream stream, long index, AtomicReference StreamPlusValue) {
// Note: It is done this way to avoid interpreting 'null' as no-value
val ref = new AtomicReference