All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.vertexium.cypher.VertexiumCypherResult Maven / Gradle / Ivy

There is a newer version: 4.10.0
Show newest version
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 predicate) {
        return new VertexiumCypherResult(
            stream.filter(predicate),
            getColumnNames()
        );
    }

    @Override
    public  Stream map(Function mapper) {
        return stream.map(mapper);
    }

    @Override
    public IntStream mapToInt(ToIntFunction mapper) {
        return stream.mapToInt(mapper);
    }

    @Override
    public LongStream mapToLong(ToLongFunction mapper) {
        return stream.mapToLong(mapper);
    }

    @Override
    public DoubleStream mapToDouble(ToDoubleFunction mapper) {
        return stream.mapToDouble(mapper);
    }

    @Override
    public  Stream flatMap(Function> mapper) {
        return stream.flatMap(mapper);
    }

    public VertexiumCypherResult flatMapCypherResult(Function> mapper) {
        return new VertexiumCypherResult(
            stream.flatMap(mapper),
            getColumnNames()
        );
    }

    @Override
    public IntStream flatMapToInt(Function mapper) {
        return stream.flatMapToInt(mapper);
    }

    @Override
    public LongStream flatMapToLong(Function mapper) {
        return stream.flatMapToLong(mapper);
    }

    @Override
    public DoubleStream flatMapToDouble(Function 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 comparator) {
        return new VertexiumCypherResult(
            stream.sorted(comparator),
            this.getColumnNames()
        );
    }

    @Override
    public VertexiumCypherResult peek(Consumer 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 action) {
        stream.forEach(action);
    }

    @Override
    public void forEachOrdered(Consumer 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 collector) {
        return stream.collect(collector);
    }

    @Override
    public Optional min(Comparator comparator) {
        return stream.min(comparator);
    }

    @Override
    public Optional max(Comparator comparator) {
        return stream.max(comparator);
    }

    @Override
    public long count() {
        return stream.count();
    }

    @Override
    public boolean anyMatch(Predicate predicate) {
        return stream.anyMatch(predicate);
    }

    @Override
    public boolean allMatch(Predicate predicate) {
        return stream.allMatch(predicate);
    }

    @Override
    public boolean noneMatch(Predicate 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 a, Stream b) {
        return Stream.concat(a, b);
    }
}