Given a mapper function, creates an immutable view collection for given collection. The elements of the resulting collection are mapped from given collection. @param c the backing collection @param mapper the function maps elements in backing collection to the ones in view
(
Collection<T> c, Function<T, R> mapper, Predicate<Object> contains)
| 51 | * @return an immutable view collection. |
| 52 | */ |
| 53 | public static <T, R> Collection<R> toMappedCollection( |
| 54 | Collection<T> c, Function<T, R> mapper, Predicate<Object> contains) { |
| 55 | return Collections.unmodifiableCollection( |
| 56 | new MappedCollectionView<>(c, mapper, contains)); |
| 57 | } |
| 58 | |
| 59 | /** |
| 60 | * Given a mapper function, creates an immutable view collection |