Uses of Class
com.google.mu.util.BiOptional
Packages that use BiOptional
Package
Description
StringFormat, Substring, Optionals and more...
BiStream, BiCollector, MoreStreams, MoreCollectors etc.
- 
Uses of BiOptional in com.google.mu.util
Methods in com.google.mu.util that return BiOptionalModifier and TypeMethodDescriptionstatic <A,B> BiOptional <A, B> Ifaandbare present, returns aBiOptionalinstance containing them; otherwise returns an emptyBiOptional.static <A,B> BiOptional <A, B> BiOptional.empty()Returns an emptyBiOptionalinstance.abstract BiOptional<A, B> BiOptional.filter(BiPredicate<? super A, ? super B> predicate) If a pair of values is present and matchespredicate, return thisBiOptional instance.default BiOptional<A, B> Both.filter(BiPredicate<? super A, ? super B> condition) static <T,A, B> BiOptional <A, B> BiOptional.flatMap(Optional<T> optional, Function<? super T, ? extends BiOptional<? extends A, ? extends B>> mapper) Maps the value contained inoptionalto aBiOptionalusingmapper, or else returns empty.static <T> BiOptional<T, T> Ifoptionalis present with valuev, adapts it toBiOptionalcontaining values(v, v).static <A,B> BiOptional <A, B> Optionals.inOrder(Optional<? extends A> step1, Function<? super A, ? extends Optional<? extends B>> step2) Similar toOptionals.both(java.util.Optional<? extends A>, java.util.Optional<? extends B>), but only evaluatesstep2ifstep1is present.static <A,B> BiOptional <A, B> Similar toOptionals.both(java.util.Optional<? extends A>, java.util.Optional<? extends B>), but only evaluatesstep2ifstep1is present.abstract <A2,B2> BiOptional <A2, B2> BiOptional.map(BiFunction<? super A, ? super B, ? extends A2> aMapper, BiFunction<? super A, ? super B, ? extends B2> bMapper) If a pair of values is present, applyaMapperandbMapperto them, and if both results are non-null, return a newBiOptionalinstance containing the results.abstract <A2,B2> BiOptional <A2, B2> BiOptional.map(Function<? super A, ? extends A2> aMapper, Function<? super B, ? extends B2> bMapper) If a pair of values is present, applyaMapperandbMapperto each respectively, and if both results are non-null, return a newBiOptionalinstance containing the results.static <A,B> BiOptional <A, B> BiOptional.of(A a, B b) Returns aBiOptionalcontaining the pair(a, b).abstract BiOptional<A, B> BiOptional.or(Supplier<? extends BiOptional<? extends A, ? extends B>> alternative) If a pair of values are present, return thisBiOptionalinstance.abstract BiOptional<A, B> BiOptional.peek(BiConsumer<? super A, ? super B> consumer) Invokesconsumerwith the pair if present and returns this object as is.BiOptional<A, B> BiOptional.skipIf(BiPredicate<? super A, ? super B> predicate) If a pair of values is present and matchespredicate, the pair is skipped (returns empty).default BiOptional<A, B> Both.skipIf(BiPredicate<? super A, ? super B> predicate) If the pair matchespredicate, it's skipped (returns empty).final BiOptional<String, String> Substring.Pattern.split(CharSequence string) Splitsstringinto two parts that are separated by this separator pattern.final BiOptional<String, String> Substring.Pattern.splitThenTrim(CharSequence string) Splitsstringinto two parts that are separated by this separator pattern, with leading and trailing whitespaces trimmed.Methods in com.google.mu.util with parameters of type BiOptionalModifier and TypeMethodDescriptionOptionals.ifPresent(BiOptional<A, B> optional, CheckedBiConsumer<? super A, ? super B, E> consumer) Runsactionif the pair is present.Method parameters in com.google.mu.util with type arguments of type BiOptionalModifier and TypeMethodDescriptionstatic <T,A, B> BiOptional <A, B> BiOptional.flatMap(Optional<T> optional, Function<? super T, ? extends BiOptional<? extends A, ? extends B>> mapper) Maps the value contained inoptionalto aBiOptionalusingmapper, or else returns empty.abstract BiOptional<A, B> BiOptional.or(Supplier<? extends BiOptional<? extends A, ? extends B>> alternative) If a pair of values are present, return thisBiOptionalinstance. - 
Uses of BiOptional in com.google.mu.util.stream
Methods in com.google.mu.util.stream that return BiOptionalModifier and TypeMethodDescriptionfinal BiOptional<K, V> BiStream.findAny()Returns any pair from this stream, orBiOptional.empty()if the stream is empty.final BiOptional<K, V> BiStream.findFirst()Returns the first pair from this stream, orBiOptional.empty()if the stream is empty.Methods in com.google.mu.util.stream that return types with arguments of type BiOptionalModifier and TypeMethodDescriptionstatic <K,V> BiCollector <K, V, BiOptional<K, V>> BiCollectors.maxBy(Comparator<? super K> keyComparator, Comparator<? super V> valueComparator) Returns aBiCollectorthat finds the maximum pair according tokeyComparatorand thenvalueComparatorfor equal keys.static <K,V> BiCollector <K, V, BiOptional<K, V>> BiCollectors.maxByKey(Comparator<? super K> comparator) Returns aBiCollectorthat finds the pair with the maximum key according tocomparator.static <K,V> BiCollector <K, V, BiOptional<K, V>> BiCollectors.maxByValue(Comparator<? super V> comparator) Returns aBiCollectorthat finds the pair with the maximum value according tocomparator.static <K,V> BiCollector <K, V, BiOptional<K, V>> BiCollectors.minBy(Comparator<? super K> keyComparator, Comparator<? super V> valueComparator) Returns aBiCollectorthat finds the minimum pair according tokeyComparatorand thenvalueComparatorfor equal keys.static <K,V> BiCollector <K, V, BiOptional<K, V>> BiCollectors.minByKey(Comparator<? super K> comparator) Returns aBiCollectorthat finds the pair with the minimum key according tocomparator.static <K,V> BiCollector <K, V, BiOptional<K, V>> BiCollectors.minByValue(Comparator<? super V> comparator) Returns aBiCollectorthat finds the pair with the minimum value according tocomparator.static <T> Collector<T, ?, BiOptional<T, T>> MoreCollectors.minMax(Comparator<? super T> comparator) Returns a collector that collects the minimum and maximum elements from the input elements.Method parameters in com.google.mu.util.stream with type arguments of type BiOptionalModifier and TypeMethodDescriptionfinal <K2,V2> BiStream <K2, V2> BiStream.mapIfPresent(BiFunction<? super K, ? super V, ? extends BiOptional<? extends K2, ? extends V2>> mapper) Returns aBiStreamconsisting of the results of applyingmapperfunction to the pairs in thisBiStream.