Package de.team33.patterns.enums.pan
Class Values<E extends Enum<E>>
java.lang.Object
de.team33.patterns.enums.pan.Values<E>
- Type Parameters:
E- The enum type whose values should be handled.
A Tool to handle enum values.
-
Method Summary
Modifier and TypeMethodDescriptionReturns aStreamof those values of the underlying enum type that match the given filter.Returns an optional value of the associated enum type that matches the given filter or, if no such value exists,Optional.empty().final EReturns a value of the associated enum type that matches the given filter or, if no such value exists, the given fallback.Returns the optional first value of the associated enum type that matches the given filter or, if no such value exists,Optional.empty().final EReturns the first value of the associated enum type that matches the given filter or, if no such value exists, the given fallback.final <T> Stream<T>Just likestream().map(mapping).final <T> Stream<T>Just likefindAll(filter).map(mapping).final <R> Optional<R>Just likefindAny(filter).map(mapping).final <R> Optional<R>Just likefindFirst(filter).map(mapping).Returns a tool instance to handle the values of the given enum class.stream()Returns aStreamover all values of the underlying enum type.
-
Method Details
-
of
Returns a tool instance to handle the values of the given enum class. -
stream
Returns aStreamover all values of the underlying enum type. -
findAll
Returns aStreamof those values of the underlying enum type that match the given filter. -
findAny
Returns an optional value of the associated enum type that matches the given filter or, if no such value exists,Optional.empty(). -
findAny
Returns a value of the associated enum type that matches the given filter or, if no such value exists, the given fallback. -
findFirst
Returns the optional first value of the associated enum type that matches the given filter or, if no such value exists,Optional.empty(). -
findFirst
Returns the first value of the associated enum type that matches the given filter or, if no such value exists, the given fallback. -
mapAll
Just likestream().map(mapping). -
mapAll
public final <T> Stream<T> mapAll(Predicate<? super E> filter, Function<? super E, ? extends T> mapping) Just likefindAll(filter).map(mapping). -
mapAny
public final <R> Optional<R> mapAny(Predicate<? super E> filter, Function<? super E, ? extends R> mapping) Just likefindAny(filter).map(mapping). -
mapFirst
public final <R> Optional<R> mapFirst(Predicate<? super E> filter, Function<? super E, ? extends R> mapping) Just likefindFirst(filter).map(mapping).
-