Uses of Interface
com.google.mu.function.MapFrom5
Package
Description
A few useful collections.
BiStream, BiCollector, MoreStreams, MoreCollectors etc.
-
Uses of MapFrom5 in com.google.mu.collect
Modifier and TypeMethodDescriptionstatic <T,
R> Optional <R> MoreCollections.findFirstElements
(Collection<T> collection, MapFrom5<? super T, ? extends R> found) Ifcollection
has at least 5 elements, passes the first 5 elements tofound
function and returns the non-null result wrapped in anOptional
, or else returnsOptional.empty()
.static <T,
R> Optional <R> MoreCollections.findOnlyElements
(Collection<T> collection, MapFrom5<? super T, ? extends R> found) Ifcollection
has exactly 5 elements, passes the 5 elements tofound
function and returns the non-null result wrapped in anOptional
, or else returnsOptional.empty()
. -
Uses of MapFrom5 in com.google.mu.util.stream
Modifier and TypeMethodDescriptionstatic <T,
R> FixedSizeCollector <T, ?, R> Returns a collector that collects the only five elements from the input and transforms them using themapper
function.static <T,
R> FixedSizeCollector <T, ?, R> MoreCollectors.onlyElements
(MapFrom5<? super T, ? extends R> mapper) Same asMoreCollectors.combining(MapFrom5)
.