Class ELStream<T>
java.lang.Object
io.micronaut.el.stream.ELStream<T>
- Type Parameters:
T- The type of the elements, which the compiler knows from the source of the stream
The
Stream implementation class described in the section 2.3.3.1 of the Jakarta Expression
Language specification.- Since:
- 1.0
- Author:
- Denis Stepanov
-
Method Summary
Modifier and TypeMethodDescriptionallMatch(jakarta.el.LambdaExpression predicate) anyMatch(jakarta.el.LambdaExpression predicate) average()count()distinct()filter(jakarta.el.LambdaExpression predicate) flatMap(jakarta.el.LambdaExpression mapper) <R> ELStream<R> @Nullable ObjectforEach(jakarta.el.LambdaExpression consumer) @Nullable Object@Nullable ObjectinvokeOperation(String name, Object[] arguments) Invokes one of the operations of this class, avoiding the reflective dispatch of the standard resolvers.iterator()map(jakarta.el.LambdaExpression mapper) <R> ELStream<R> max()max(jakarta.el.LambdaExpression comparator) max(Comparator<? super T> comparator) min()min(jakarta.el.LambdaExpression comparator) min(Comparator<? super T> comparator) noneMatch(jakarta.el.LambdaExpression predicate) Creates a stream from aCollectionor a Java array.peek(jakarta.el.LambdaExpression consumer) reduce(jakarta.el.LambdaExpression binaryOperator) @Nullable Object@Nullable Objectreduce(@Nullable Object seed, BinaryOperator<@Nullable Object> binaryOperator) reduce(BinaryOperator<T> binaryOperator) sorted()sorted(jakarta.el.LambdaExpression comparator) sorted(Comparator<? super T> comparator) sum()Object[]toArray()toList()
-
Method Details
-
of
Creates a stream from aCollectionor a Java array.- Parameters:
context- The contextsource- The source of the stream- Returns:
- The stream
-
filter
-
filter
-
map
-
map
-
flatMap
-
flatMap
-
distinct
-
sorted
-
sorted
-
sorted
- Parameters:
comparator- The comparator, as compiled from a lambda expression- Returns:
- A stream of the elements sorted with the comparator
-
forEach
- Parameters:
consumer- The consumer invoked for every element- Returns:
- Always
null
-
forEach
-
peek
-
peek
-
iterator
-
limit
-
substream
-
substream
-
toArray
- Returns:
- An array of the elements of the stream
-
toList
-
reduce
- Parameters:
binaryOperator- The accumulator- Returns:
- An optional holding the reduced value
-
reduce
- Parameters:
binaryOperator- The accumulator, as compiled from a lambda expression- Returns:
- An optional holding the reduced value
-
reduce
-
reduce
public @Nullable Object reduce(@Nullable Object seed, BinaryOperator<@Nullable Object> binaryOperator) - Parameters:
seed- The seedbinaryOperator- The accumulator, as compiled from a lambda expression- Returns:
- The reduced value
-
max
- Returns:
- An optional holding the maximum element
-
max
- Parameters:
comparator- The comparator- Returns:
- An optional holding the maximum element
-
max
- Parameters:
comparator- The comparator, as compiled from a lambda expression- Returns:
- An optional holding the maximum element
-
min
- Returns:
- An optional holding the minimum element
-
min
- Parameters:
comparator- The comparator- Returns:
- An optional holding the minimum element
-
min
- Parameters:
comparator- The comparator, as compiled from a lambda expression- Returns:
- An optional holding the minimum element
-
average
- Returns:
- An optional holding the average of the elements
-
sum
- Returns:
- The sum of the elements, zero for an empty stream
-
count
- Returns:
- The number of elements of the stream
-
anyMatch
- Parameters:
predicate- The predicate- Returns:
- An optional holding true when any element matches, empty for an empty stream
-
anyMatch
- Parameters:
predicate- The predicate, as compiled from a lambda expression- Returns:
- The same as
anyMatch(LambdaExpression)
-
allMatch
- Parameters:
predicate- The predicate- Returns:
- An optional holding true when all the elements match, empty for an empty stream
-
allMatch
- Parameters:
predicate- The predicate, as compiled from a lambda expression- Returns:
- The same as
allMatch(LambdaExpression)
-
noneMatch
- Parameters:
predicate- The predicate- Returns:
- An optional holding true when no element matches, empty for an empty stream
-
noneMatch
- Parameters:
predicate- The predicate, as compiled from a lambda expression- Returns:
- The same as
noneMatch(LambdaExpression)
-
findFirst
- Returns:
- An optional holding the first element of the stream
-
invokeOperation
-