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

net.jqwik.engine.properties.arbitraries.ReportableStream Maven / Gradle / Ivy

There is a newer version: 1.9.1
Show newest version
package net.jqwik.engine.properties.arbitraries;

import java.util.*;
import java.util.function.*;
import java.util.stream.*;

import net.jqwik.engine.support.*;

import org.jspecify.annotations.*;

public class ReportableStream implements Stream {

	private final List values;
	private final Stream stream;

	ReportableStream(List list) {
		this.values = list;
		this.stream = list.stream();
	}

	public List values() {
		return values;
	}

	@Override
	public String toString() {
		return String.format("%s.of(%s)", getClass().getName(), JqwikStringSupport.displayString(values));
	}

	@Override
	public Stream filter(final Predicate predicate) {
		return stream.filter(predicate);
	}

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

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

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

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

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

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

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

	@Override
	public DoubleStream flatMapToDouble(final Function mapper) {
		return stream.flatMapToDouble(mapper);
	}

	@Override
	public Stream distinct() {
		return stream.distinct();
	}

	@Override
	public Stream sorted() {
		return stream.sorted();
	}

	@Override
	public Stream sorted(final Comparator comparator) {
		return stream.sorted(comparator);
	}

	@Override
	public Stream peek(final Consumer action) {
		return stream.peek(action);
	}

	@Override
	public Stream limit(final long maxSize) {
		return stream.limit(maxSize);
	}

	@Override
	public Stream skip(final long n) {
		return stream.skip(n);
	}

	@Override
	public void forEach(final Consumer action) {
		stream.forEach(action);
	}

	@Override
	public void forEachOrdered(final Consumer action) {
		stream.forEachOrdered(action);
	}

	@Override
	public Object[] toArray() {
		return stream.toArray();
	}

	@Override
	public  A[] toArray(final IntFunction generator) {
		return stream.toArray(generator);
	}

	@Override
	public T reduce(final T identity, final BinaryOperator accumulator) {
		return stream.reduce(identity, accumulator);
	}

	@Override
	public Optional reduce(final BinaryOperator accumulator) {
		return stream.reduce(accumulator);
	}

	@Override
	public  U reduce(final U identity, final BiFunction accumulator, final BinaryOperator combiner) {
		return stream.reduce(identity, accumulator, combiner);
	}

	@Override
	public  R collect(final Supplier supplier, final BiConsumer accumulator, final BiConsumer combiner) {
		return stream.collect(supplier, accumulator, combiner);
	}

	@Override
	public  R collect(final Collector collector) {
		return stream.collect(collector);
	}

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

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

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

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

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

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

	@Override
	public Optional findFirst() {
		return stream.findFirst();
	}

	@Override
	public Optional findAny() {
		return stream.findAny();
	}

	@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(final Runnable closeHandler) {
		return stream.onClose(closeHandler);
	}

	@Override
	public void close() {
		stream.close();
	}
}