org.vertexium.cypher.VertexiumCypherResult Maven / Gradle / Ivy
package org.vertexium.cypher;
import java.util.*;
import java.util.function.*;
import java.util.stream.*;
public class VertexiumCypherResult implements Stream {
private final Stream stream;
private final LinkedHashSet columnNames;
public VertexiumCypherResult(Stream stream, LinkedHashSet columnNames) {
this.stream = stream;
this.columnNames = columnNames;
}
public LinkedHashSet getColumnNames() {
return columnNames;
}
@Override
public Iterator iterator() {
return stream.iterator();
}
@Override
public Spliterator spliterator() {
return stream.spliterator();
}
@Override
public boolean isParallel() {
return stream.isParallel();
}
@Override
public Stream sequential() {
return stream.sequential();
}
@Override
public Stream parallel() {
return stream.parallel();
}
@Override
public Stream unordered() {
return stream.unordered();
}
@Override
public Stream onClose(Runnable closeHandler) {
return stream.onClose(closeHandler);
}
@Override
public void close() {
stream.close();
}
@Override
public VertexiumCypherResult filter(Predicate super CypherResultRow> predicate) {
return new VertexiumCypherResult(
stream.filter(predicate),
getColumnNames()
);
}
@Override
public Stream map(Function super CypherResultRow, ? extends R> mapper) {
return stream.map(mapper);
}
@Override
public IntStream mapToInt(ToIntFunction super CypherResultRow> mapper) {
return stream.mapToInt(mapper);
}
@Override
public LongStream mapToLong(ToLongFunction super CypherResultRow> mapper) {
return stream.mapToLong(mapper);
}
@Override
public DoubleStream mapToDouble(ToDoubleFunction super CypherResultRow> mapper) {
return stream.mapToDouble(mapper);
}
@Override
public Stream flatMap(Function super CypherResultRow, ? extends Stream extends R>> mapper) {
return stream.flatMap(mapper);
}
public VertexiumCypherResult flatMapCypherResult(Function super CypherResultRow, ? extends Stream extends CypherResultRow>> mapper) {
return new VertexiumCypherResult(
stream.flatMap(mapper),
getColumnNames()
);
}
@Override
public IntStream flatMapToInt(Function super CypherResultRow, ? extends IntStream> mapper) {
return stream.flatMapToInt(mapper);
}
@Override
public LongStream flatMapToLong(Function super CypherResultRow, ? extends LongStream> mapper) {
return stream.flatMapToLong(mapper);
}
@Override
public DoubleStream flatMapToDouble(Function super CypherResultRow, ? extends DoubleStream> mapper) {
return stream.flatMapToDouble(mapper);
}
@Override
public VertexiumCypherResult distinct() {
return new VertexiumCypherResult(
stream.distinct(),
getColumnNames()
);
}
@Override
public Stream sorted() {
return stream.sorted();
}
@Override
public VertexiumCypherResult sorted(Comparator super CypherResultRow> comparator) {
return new VertexiumCypherResult(
stream.sorted(comparator),
this.getColumnNames()
);
}
@Override
public VertexiumCypherResult peek(Consumer super CypherResultRow> action) {
return new VertexiumCypherResult(
stream.peek(action),
this.getColumnNames()
);
}
@Override
public Stream limit(long maxSize) {
return stream.limit(maxSize);
}
@Override
public Stream skip(long n) {
return stream.skip(n);
}
@Override
public void forEach(Consumer super CypherResultRow> action) {
stream.forEach(action);
}
@Override
public void forEachOrdered(Consumer super CypherResultRow> action) {
stream.forEachOrdered(action);
}
@Override
public Object[] toArray() {
return stream.toArray();
}
@Override
public A[] toArray(IntFunction generator) {
return stream.toArray(generator);
}
@Override
public CypherResultRow reduce(CypherResultRow identity, BinaryOperator accumulator) {
return stream.reduce(identity, accumulator);
}
@Override
public Optional reduce(BinaryOperator accumulator) {
return stream.reduce(accumulator);
}
@Override
public U reduce(U identity, BiFunction accumulator, BinaryOperator combiner) {
return stream.reduce(identity, accumulator, combiner);
}
@Override
public R collect(Supplier supplier, BiConsumer accumulator, BiConsumer combiner) {
return stream.collect(supplier, accumulator, combiner);
}
@Override
public R collect(Collector super CypherResultRow, A, R> collector) {
return stream.collect(collector);
}
@Override
public Optional min(Comparator super CypherResultRow> comparator) {
return stream.min(comparator);
}
@Override
public Optional max(Comparator super CypherResultRow> comparator) {
return stream.max(comparator);
}
@Override
public long count() {
return stream.count();
}
@Override
public boolean anyMatch(Predicate super CypherResultRow> predicate) {
return stream.anyMatch(predicate);
}
@Override
public boolean allMatch(Predicate super CypherResultRow> predicate) {
return stream.allMatch(predicate);
}
@Override
public boolean noneMatch(Predicate super CypherResultRow> predicate) {
return stream.noneMatch(predicate);
}
@Override
public Optional findFirst() {
return stream.findFirst();
}
@Override
public Optional findAny() {
return stream.findAny();
}
public static Builder builder() {
return Stream.builder();
}
public static Stream empty() {
return Stream.empty();
}
public static Stream of(T t) {
return Stream.of(t);
}
@SafeVarargs
public static Stream of(T... values) {
return Stream.of(values);
}
public static Stream iterate(T seed, UnaryOperator f) {
return Stream.iterate(seed, f);
}
public static Stream generate(Supplier s) {
return Stream.generate(s);
}
public static Stream concat(Stream extends T> a, Stream extends T> b) {
return Stream.concat(a, b);
}
}