Class Maps


  • final class Maps
    extends java.lang.Object
    INTERNAL: Common Map functions (not intended to be public).
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      (package private) static interface  Maps.OfEntries<K,​V,​M extends Map<K,​V>>  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Maps()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static <K,​V,​M extends Map<K,​V>>
      Tuple2<V,​M>
      computeIfAbsent​(M map, K key, java.util.function.Function<? super K,​? extends V> mappingFunction)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      Tuple2<Option<V>,​M>
      computeIfPresent​(M map, K key, java.util.function.BiFunction<? super K,​? super V,​? extends V> remappingFunction)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      distinct​(M map)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      distinctBy​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.Comparator<? super Tuple2<K,​V>> comparator)  
      (package private) static <K,​V,​U,​M extends Map<K,​V>>
      M
      distinctBy​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Function<? super Tuple2<K,​V>,​? extends U> keyExtractor)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      drop​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Supplier<M> emptySupplier, int n)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      dropRight​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Supplier<M> emptySupplier, int n)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      dropUntil​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Predicate<? super Tuple2<K,​V>> predicate)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      dropWhile​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Predicate<? super Tuple2<K,​V>> predicate)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      filter​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.BiPredicate<? super K,​? super V> predicate)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      filter​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Predicate<? super Tuple2<K,​V>> predicate)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      filterKeys​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Predicate<? super K> predicate)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      filterValues​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Predicate<? super V> predicate)  
      (package private) static <K,​V,​C,​M extends Map<K,​V>>
      Map<C,​M>
      groupBy​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Function<? super Tuple2<K,​V>,​? extends C> classifier)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      Iterator<M>
      grouped​(M map, Maps.OfEntries<K,​V,​M> ofEntries, int size)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      Option<M>
      initOption​(M map)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      merge​(M map, Maps.OfEntries<K,​V,​M> ofEntries, Map<? extends K,​? extends V> that)  
      (package private) static <K,​V,​U extends V,​M extends Map<K,​V>>
      M
      merge​(M map, Maps.OfEntries<K,​V,​M> ofEntries, Map<? extends K,​U> that, java.util.function.BiFunction<? super V,​? super U,​? extends V> collisionResolution)  
      (package private) static <T,​K,​V,​M extends Map<K,​V>>
      M
      ofStream​(M map, java.util.stream.Stream<? extends T> stream, java.util.function.Function<? super T,​? extends K> keyMapper, java.util.function.Function<? super T,​? extends V> valueMapper)  
      (package private) static <T,​K,​V,​M extends Map<K,​V>>
      M
      ofStream​(M map, java.util.stream.Stream<? extends T> stream, java.util.function.Function<? super T,​Tuple2<? extends K,​? extends V>> entryMapper)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      Tuple2<M,​M>
      partition​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Predicate<? super Tuple2<K,​V>> predicate)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      peek​(M map, java.util.function.Consumer<? super Tuple2<K,​V>> action)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      put​(M map, Tuple2<? extends K,​? extends V> entry)  
      (package private) static <K,​V,​U extends V,​M extends Map<K,​V>>
      M
      put​(M map, Tuple2<? extends K,​U> entry, java.util.function.BiFunction<? super V,​? super U,​? extends V> merge)  
      (package private) static <K,​V,​U extends V,​M extends Map<K,​V>>
      M
      put​(M map, K key, U value, java.util.function.BiFunction<? super V,​? super U,​? extends V> merge)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      reject​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.BiPredicate<? super K,​? super V> predicate)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      reject​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Predicate<? super Tuple2<K,​V>> predicate)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      rejectKeys​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Predicate<? super K> predicate)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      rejectValues​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Predicate<? super V> predicate)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      replace​(M map, Tuple2<K,​V> currentElement, Tuple2<K,​V> newElement)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      replace​(M map, K key, V oldValue, V newValue)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      replaceAll​(M map, Tuple2<K,​V> currentElement, Tuple2<K,​V> newElement)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      replaceAll​(M map, java.util.function.BiFunction<? super K,​? super V,​? extends V> function)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      replaceValue​(M map, K key, V value)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      scan​(M map, Tuple2<K,​V> zero, java.util.function.BiFunction<? super Tuple2<K,​V>,​? super Tuple2<K,​V>,​? extends Tuple2<K,​V>> operation, java.util.function.Function<Iterator<Tuple2<K,​V>>,​Traversable<Tuple2<K,​V>>> finisher)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      Iterator<M>
      slideBy​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Function<? super Tuple2<K,​V>,​?> classifier)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      Iterator<M>
      sliding​(M map, Maps.OfEntries<K,​V,​M> ofEntries, int size)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      Iterator<M>
      sliding​(M map, Maps.OfEntries<K,​V,​M> ofEntries, int size, int step)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      Tuple2<M,​M>
      span​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Predicate<? super Tuple2<K,​V>> predicate)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      Option<M>
      tailOption​(M map)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      take​(M map, Maps.OfEntries<K,​V,​M> ofEntries, int n)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      takeRight​(M map, Maps.OfEntries<K,​V,​M> ofEntries, int n)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      takeUntil​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Predicate<? super Tuple2<K,​V>> predicate)  
      (package private) static <K,​V,​M extends Map<K,​V>>
      M
      takeWhile​(M map, Maps.OfEntries<K,​V,​M> ofEntries, java.util.function.Predicate<? super Tuple2<K,​V>> predicate)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Maps

        private Maps()
    • Method Detail

      • computeIfAbsent

        static <K,​V,​M extends Map<K,​V>> Tuple2<V,​M> computeIfAbsent​(M map,
                                                                                            K key,
                                                                                            java.util.function.Function<? super K,​? extends V> mappingFunction)
      • computeIfPresent

        static <K,​V,​M extends Map<K,​V>> Tuple2<Option<V>,​M> computeIfPresent​(M map,
                                                                                                     K key,
                                                                                                     java.util.function.BiFunction<? super K,​? super V,​? extends V> remappingFunction)
      • distinct

        static <K,​V,​M extends Map<K,​V>> M distinct​(M map)
      • distinctBy

        static <K,​V,​M extends Map<K,​V>> M distinctBy​(M map,
                                                                       Maps.OfEntries<K,​V,​M> ofEntries,
                                                                       java.util.Comparator<? super Tuple2<K,​V>> comparator)
      • distinctBy

        static <K,​V,​U,​M extends Map<K,​V>> M distinctBy​(M map,
                                                                               Maps.OfEntries<K,​V,​M> ofEntries,
                                                                               java.util.function.Function<? super Tuple2<K,​V>,​? extends U> keyExtractor)
      • drop

        static <K,​V,​M extends Map<K,​V>> M drop​(M map,
                                                                 Maps.OfEntries<K,​V,​M> ofEntries,
                                                                 java.util.function.Supplier<M> emptySupplier,
                                                                 int n)
      • dropRight

        static <K,​V,​M extends Map<K,​V>> M dropRight​(M map,
                                                                      Maps.OfEntries<K,​V,​M> ofEntries,
                                                                      java.util.function.Supplier<M> emptySupplier,
                                                                      int n)
      • dropUntil

        static <K,​V,​M extends Map<K,​V>> M dropUntil​(M map,
                                                                      Maps.OfEntries<K,​V,​M> ofEntries,
                                                                      java.util.function.Predicate<? super Tuple2<K,​V>> predicate)
      • dropWhile

        static <K,​V,​M extends Map<K,​V>> M dropWhile​(M map,
                                                                      Maps.OfEntries<K,​V,​M> ofEntries,
                                                                      java.util.function.Predicate<? super Tuple2<K,​V>> predicate)
      • filter

        static <K,​V,​M extends Map<K,​V>> M filter​(M map,
                                                                   Maps.OfEntries<K,​V,​M> ofEntries,
                                                                   java.util.function.BiPredicate<? super K,​? super V> predicate)
      • filter

        static <K,​V,​M extends Map<K,​V>> M filter​(M map,
                                                                   Maps.OfEntries<K,​V,​M> ofEntries,
                                                                   java.util.function.Predicate<? super Tuple2<K,​V>> predicate)
      • filterKeys

        static <K,​V,​M extends Map<K,​V>> M filterKeys​(M map,
                                                                       Maps.OfEntries<K,​V,​M> ofEntries,
                                                                       java.util.function.Predicate<? super K> predicate)
      • filterValues

        static <K,​V,​M extends Map<K,​V>> M filterValues​(M map,
                                                                         Maps.OfEntries<K,​V,​M> ofEntries,
                                                                         java.util.function.Predicate<? super V> predicate)
      • groupBy

        static <K,​V,​C,​M extends Map<K,​V>> Map<C,​M> groupBy​(M map,
                                                                                         Maps.OfEntries<K,​V,​M> ofEntries,
                                                                                         java.util.function.Function<? super Tuple2<K,​V>,​? extends C> classifier)
      • grouped

        static <K,​V,​M extends Map<K,​V>> Iterator<M> grouped​(M map,
                                                                              Maps.OfEntries<K,​V,​M> ofEntries,
                                                                              int size)
      • initOption

        static <K,​V,​M extends Map<K,​V>> Option<M> initOption​(M map)
      • merge

        static <K,​V,​M extends Map<K,​V>> M merge​(M map,
                                                                  Maps.OfEntries<K,​V,​M> ofEntries,
                                                                  Map<? extends K,​? extends V> that)
      • merge

        static <K,​V,​U extends V,​M extends Map<K,​V>> M merge​(M map,
                                                                                    Maps.OfEntries<K,​V,​M> ofEntries,
                                                                                    Map<? extends K,​U> that,
                                                                                    java.util.function.BiFunction<? super V,​? super U,​? extends V> collisionResolution)
      • ofStream

        static <T,​K,​V,​M extends Map<K,​V>> M ofStream​(M map,
                                                                             java.util.stream.Stream<? extends T> stream,
                                                                             java.util.function.Function<? super T,​? extends K> keyMapper,
                                                                             java.util.function.Function<? super T,​? extends V> valueMapper)
      • ofStream

        static <T,​K,​V,​M extends Map<K,​V>> M ofStream​(M map,
                                                                             java.util.stream.Stream<? extends T> stream,
                                                                             java.util.function.Function<? super T,​Tuple2<? extends K,​? extends V>> entryMapper)
      • partition

        static <K,​V,​M extends Map<K,​V>> Tuple2<M,​M> partition​(M map,
                                                                                      Maps.OfEntries<K,​V,​M> ofEntries,
                                                                                      java.util.function.Predicate<? super Tuple2<K,​V>> predicate)
      • peek

        static <K,​V,​M extends Map<K,​V>> M peek​(M map,
                                                                 java.util.function.Consumer<? super Tuple2<K,​V>> action)
      • put

        static <K,​V,​U extends V,​M extends Map<K,​V>> M put​(M map,
                                                                                  K key,
                                                                                  U value,
                                                                                  java.util.function.BiFunction<? super V,​? super U,​? extends V> merge)
      • put

        static <K,​V,​M extends Map<K,​V>> M put​(M map,
                                                                Tuple2<? extends K,​? extends V> entry)
      • put

        static <K,​V,​U extends V,​M extends Map<K,​V>> M put​(M map,
                                                                                  Tuple2<? extends K,​U> entry,
                                                                                  java.util.function.BiFunction<? super V,​? super U,​? extends V> merge)
      • reject

        static <K,​V,​M extends Map<K,​V>> M reject​(M map,
                                                                   Maps.OfEntries<K,​V,​M> ofEntries,
                                                                   java.util.function.Predicate<? super Tuple2<K,​V>> predicate)
      • reject

        static <K,​V,​M extends Map<K,​V>> M reject​(M map,
                                                                   Maps.OfEntries<K,​V,​M> ofEntries,
                                                                   java.util.function.BiPredicate<? super K,​? super V> predicate)
      • rejectKeys

        static <K,​V,​M extends Map<K,​V>> M rejectKeys​(M map,
                                                                       Maps.OfEntries<K,​V,​M> ofEntries,
                                                                       java.util.function.Predicate<? super K> predicate)
      • rejectValues

        static <K,​V,​M extends Map<K,​V>> M rejectValues​(M map,
                                                                         Maps.OfEntries<K,​V,​M> ofEntries,
                                                                         java.util.function.Predicate<? super V> predicate)
      • replace

        static <K,​V,​M extends Map<K,​V>> M replace​(M map,
                                                                    K key,
                                                                    V oldValue,
                                                                    V newValue)
      • replace

        static <K,​V,​M extends Map<K,​V>> M replace​(M map,
                                                                    Tuple2<K,​V> currentElement,
                                                                    Tuple2<K,​V> newElement)
      • replaceAll

        static <K,​V,​M extends Map<K,​V>> M replaceAll​(M map,
                                                                       java.util.function.BiFunction<? super K,​? super V,​? extends V> function)
      • replaceAll

        static <K,​V,​M extends Map<K,​V>> M replaceAll​(M map,
                                                                       Tuple2<K,​V> currentElement,
                                                                       Tuple2<K,​V> newElement)
      • replaceValue

        static <K,​V,​M extends Map<K,​V>> M replaceValue​(M map,
                                                                         K key,
                                                                         V value)
      • scan

        static <K,​V,​M extends Map<K,​V>> M scan​(M map,
                                                                 Tuple2<K,​V> zero,
                                                                 java.util.function.BiFunction<? super Tuple2<K,​V>,​? super Tuple2<K,​V>,​? extends Tuple2<K,​V>> operation,
                                                                 java.util.function.Function<Iterator<Tuple2<K,​V>>,​Traversable<Tuple2<K,​V>>> finisher)
      • slideBy

        static <K,​V,​M extends Map<K,​V>> Iterator<M> slideBy​(M map,
                                                                              Maps.OfEntries<K,​V,​M> ofEntries,
                                                                              java.util.function.Function<? super Tuple2<K,​V>,​?> classifier)
      • sliding

        static <K,​V,​M extends Map<K,​V>> Iterator<M> sliding​(M map,
                                                                              Maps.OfEntries<K,​V,​M> ofEntries,
                                                                              int size)
      • sliding

        static <K,​V,​M extends Map<K,​V>> Iterator<M> sliding​(M map,
                                                                              Maps.OfEntries<K,​V,​M> ofEntries,
                                                                              int size,
                                                                              int step)
      • span

        static <K,​V,​M extends Map<K,​V>> Tuple2<M,​M> span​(M map,
                                                                                 Maps.OfEntries<K,​V,​M> ofEntries,
                                                                                 java.util.function.Predicate<? super Tuple2<K,​V>> predicate)
      • tailOption

        static <K,​V,​M extends Map<K,​V>> Option<M> tailOption​(M map)
      • take

        static <K,​V,​M extends Map<K,​V>> M take​(M map,
                                                                 Maps.OfEntries<K,​V,​M> ofEntries,
                                                                 int n)
      • takeRight

        static <K,​V,​M extends Map<K,​V>> M takeRight​(M map,
                                                                      Maps.OfEntries<K,​V,​M> ofEntries,
                                                                      int n)
      • takeUntil

        static <K,​V,​M extends Map<K,​V>> M takeUntil​(M map,
                                                                      Maps.OfEntries<K,​V,​M> ofEntries,
                                                                      java.util.function.Predicate<? super Tuple2<K,​V>> predicate)
      • takeWhile

        static <K,​V,​M extends Map<K,​V>> M takeWhile​(M map,
                                                                      Maps.OfEntries<K,​V,​M> ofEntries,
                                                                      java.util.function.Predicate<? super Tuple2<K,​V>> predicate)