Package org.hibernate.query.spi
Class LongStreamDecorator
- java.lang.Object
-
- org.hibernate.query.spi.LongStreamDecorator
-
- All Implemented Interfaces:
AutoCloseable
,BaseStream<Long,LongStream>
,LongStream
public class LongStreamDecorator extends Object implements LongStream
TheLongStreamDecorator
wraps a JavaLongStream
and registers acloseHandler
which is passed further to any resultingStream
. The goal of theLongStreamDecorator
is to close the underlyingLongStream
upon calling a terminal operation.- Since:
- 5.4
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface java.util.stream.LongStream
LongStream.Builder
-
-
Constructor Summary
Constructors Constructor Description LongStreamDecorator(LongStream delegate, Runnable closeHandler)
-
Method Summary
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.stream.LongStream
dropWhile, takeWhile
-
-
-
-
Constructor Detail
-
LongStreamDecorator
public LongStreamDecorator(LongStream delegate, Runnable closeHandler)
-
-
Method Detail
-
filter
public LongStream filter(LongPredicate predicate)
- Specified by:
filter
in interfaceLongStream
-
map
public LongStream map(LongUnaryOperator mapper)
- Specified by:
map
in interfaceLongStream
-
mapToObj
public <U> Stream<U> mapToObj(LongFunction<? extends U> mapper)
- Specified by:
mapToObj
in interfaceLongStream
-
mapToInt
public IntStream mapToInt(LongToIntFunction mapper)
- Specified by:
mapToInt
in interfaceLongStream
-
mapToDouble
public DoubleStream mapToDouble(LongToDoubleFunction mapper)
- Specified by:
mapToDouble
in interfaceLongStream
-
flatMap
public LongStream flatMap(LongFunction<? extends LongStream> mapper)
- Specified by:
flatMap
in interfaceLongStream
-
distinct
public LongStream distinct()
- Specified by:
distinct
in interfaceLongStream
-
sorted
public LongStream sorted()
- Specified by:
sorted
in interfaceLongStream
-
peek
public LongStream peek(LongConsumer action)
- Specified by:
peek
in interfaceLongStream
-
limit
public LongStream limit(long maxSize)
- Specified by:
limit
in interfaceLongStream
-
skip
public LongStream skip(long n)
- Specified by:
skip
in interfaceLongStream
-
forEach
public void forEach(LongConsumer action)
- Specified by:
forEach
in interfaceLongStream
-
forEachOrdered
public void forEachOrdered(LongConsumer action)
- Specified by:
forEachOrdered
in interfaceLongStream
-
toArray
public long[] toArray()
- Specified by:
toArray
in interfaceLongStream
-
reduce
public long reduce(long identity, LongBinaryOperator op)
- Specified by:
reduce
in interfaceLongStream
-
reduce
public OptionalLong reduce(LongBinaryOperator op)
- Specified by:
reduce
in interfaceLongStream
-
collect
public <R> R collect(Supplier<R> supplier, ObjLongConsumer<R> accumulator, BiConsumer<R,R> combiner)
- Specified by:
collect
in interfaceLongStream
-
sum
public long sum()
- Specified by:
sum
in interfaceLongStream
-
min
public OptionalLong min()
- Specified by:
min
in interfaceLongStream
-
max
public OptionalLong max()
- Specified by:
max
in interfaceLongStream
-
count
public long count()
- Specified by:
count
in interfaceLongStream
-
average
public OptionalDouble average()
- Specified by:
average
in interfaceLongStream
-
summaryStatistics
public LongSummaryStatistics summaryStatistics()
- Specified by:
summaryStatistics
in interfaceLongStream
-
anyMatch
public boolean anyMatch(LongPredicate predicate)
- Specified by:
anyMatch
in interfaceLongStream
-
allMatch
public boolean allMatch(LongPredicate predicate)
- Specified by:
allMatch
in interfaceLongStream
-
noneMatch
public boolean noneMatch(LongPredicate predicate)
- Specified by:
noneMatch
in interfaceLongStream
-
findFirst
public OptionalLong findFirst()
- Specified by:
findFirst
in interfaceLongStream
-
findAny
public OptionalLong findAny()
- Specified by:
findAny
in interfaceLongStream
-
asDoubleStream
public DoubleStream asDoubleStream()
- Specified by:
asDoubleStream
in interfaceLongStream
-
boxed
public Stream<Long> boxed()
- Specified by:
boxed
in interfaceLongStream
-
sequential
public LongStream sequential()
- Specified by:
sequential
in interfaceBaseStream<Long,LongStream>
- Specified by:
sequential
in interfaceLongStream
-
parallel
public LongStream parallel()
- Specified by:
parallel
in interfaceBaseStream<Long,LongStream>
- Specified by:
parallel
in interfaceLongStream
-
unordered
public LongStream unordered()
- Specified by:
unordered
in interfaceBaseStream<Long,LongStream>
-
onClose
public LongStream onClose(Runnable closeHandler)
- Specified by:
onClose
in interfaceBaseStream<Long,LongStream>
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceBaseStream<Long,LongStream>
-
iterator
public PrimitiveIterator.OfLong iterator()
- Specified by:
iterator
in interfaceBaseStream<Long,LongStream>
- Specified by:
iterator
in interfaceLongStream
-
spliterator
public Spliterator.OfLong spliterator()
- Specified by:
spliterator
in interfaceBaseStream<Long,LongStream>
- Specified by:
spliterator
in interfaceLongStream
-
isParallel
public boolean isParallel()
- Specified by:
isParallel
in interfaceBaseStream<Long,LongStream>
-
-