| Modifier and Type | Method and Description |
|---|---|
static <T> List<T> |
filter(Collection<T> collection,
Predicate<T> condition)
Return a new list with the filtered elements.
|
static <T> Optional<T> |
findFirst(Collection<T> collection,
Predicate<T> condition)
Return an
Optional with the first found element in collection. |
static <T,S> List<T> |
map(Collection<S> collection,
Function<S,T> mapper)
Return a new list with the new elements.
|
public static <T> List<T> filter(Collection<T> collection, Predicate<T> condition)
collection - collection of elements.condition - condition to filter the elements.public static <T,S> List<T> map(Collection<S> collection, Function<S,T> mapper)
collection - collection of elements.mapper - new element.public static <T> Optional<T> findFirst(Collection<T> collection, Predicate<T> condition)
Optional with the first found element in collection.collection - collection of elements.condition - condition to filter the element.Optional with the first found element in collection.Copyright © 2021. All rights reserved.