Class Maps


  • public final class Maps
    extends java.lang.Object
    Provides common implementations of Map interface and the variants.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.util.function.Function<java.lang.String,​java.lang.Integer> TO_INTEGER
      Deprecated.
      Use Integer::valueOf directly.
      static java.util.function.UnaryOperator<java.lang.String> TO_LOWER_CASE
      The UnaryOperator that maps a String to lower case using Locale.US.
      static java.util.function.UnaryOperator<java.lang.String> TO_UPPER_CASE
      The UnaryOperator that maps a String to upper case using Locale.US.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Maps()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      Modifier and Type Method Description
      static <F,​T>
      java.util.function.Function<F,​T>
      constant​(T v)
      Deprecated.
      Use from -> to directly.
      static <T> java.util.function.UnaryOperator<T> identity()
      Deprecated.
      Use Function.identity() instead.
      static <K,​V>
      java.util.function.Function<K,​V>
      map​(java.util.Map<K,​V> m)
      Deprecated.
      Use Map::get instead.
      static <T> Map<T,​java.lang.String> mapToString()
      Deprecated.
      Use String::valueOf directly.
      static <E extends java.lang.Enum<E>>
      java.util.function.Function<java.lang.String,​E>
      toEnum​(java.lang.Class<E> enumType)
      Returns a Map that maps the string representation of an enum to the corresponding enum value by calling Enum.valueOf(Class, String).
      static java.util.function.UnaryOperator<java.lang.String> toLowerCase​(java.util.Locale locale)
      Returns a UnaryOperator that maps a String to lower case using locale.
      static <A,​B>
      Map2<A,​B,​Pair<A,​B>>
      toPair()
      A Map2 object that maps 2 values into a Pair object.
      static <A,​B,​C>
      Map3<A,​B,​C,​Tuple3<A,​B,​C>>
      toTuple3()
      Deprecated.
      static <A,​B,​C,​D>
      Map4<A,​B,​C,​D,​Tuple4<A,​B,​C,​D>>
      toTuple4()
      Deprecated.
      static <A,​B,​C,​D,​E>
      Map5<A,​B,​C,​D,​E,​Tuple5<A,​B,​C,​D,​E>>
      toTuple5()
      Deprecated.
      static java.util.function.UnaryOperator<java.lang.String> toUpperCase​(java.util.Locale locale)
      Returns a UnaryOperator that maps a String to upper case using locale.
      • Methods inherited from class java.lang.Object

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

      • TO_INTEGER

        @Deprecated
        public static final java.util.function.Function<java.lang.String,​java.lang.Integer> TO_INTEGER
        Deprecated.
        Use Integer::valueOf directly.
        The Map that maps a String to Integer by calling Integer.valueOf(String).
      • TO_LOWER_CASE

        public static java.util.function.UnaryOperator<java.lang.String> TO_LOWER_CASE
        The UnaryOperator that maps a String to lower case using Locale.US.
      • TO_UPPER_CASE

        public static java.util.function.UnaryOperator<java.lang.String> TO_UPPER_CASE
        The UnaryOperator that maps a String to upper case using Locale.US.
    • Constructor Detail

      • Maps

        private Maps()
    • Method Detail

      • toLowerCase

        public static java.util.function.UnaryOperator<java.lang.String> toLowerCase​(java.util.Locale locale)
        Returns a UnaryOperator that maps a String to lower case using locale.
      • toUpperCase

        public static java.util.function.UnaryOperator<java.lang.String> toUpperCase​(java.util.Locale locale)
        Returns a UnaryOperator that maps a String to upper case using locale.
      • mapToString

        @Deprecated
        public static <T> Map<T,​java.lang.String> mapToString()
        Deprecated.
        Use String::valueOf directly.
      • toEnum

        public static <E extends java.lang.Enum<E>> java.util.function.Function<java.lang.String,​E> toEnum​(java.lang.Class<E> enumType)
        Returns a Map that maps the string representation of an enum to the corresponding enum value by calling Enum.valueOf(Class, String).
      • identity

        @Deprecated
        public static <T> java.util.function.UnaryOperator<T> identity()
        Deprecated.
        Use Function.identity() instead.
        Returns an identity map that maps parameter to itself.
      • constant

        @Deprecated
        public static <F,​T> java.util.function.Function<F,​T> constant​(T v)
        Deprecated.
        Use from -> to directly.
        Returns a Map that always maps any object to v.
      • map

        @Deprecated
        public static <K,​V> java.util.function.Function<K,​V> map​(java.util.Map<K,​V> m)
        Deprecated.
        Use Map::get instead.
        Adapts a Map to Map.
      • toPair

        public static <A,​B> Map2<A,​B,​Pair<A,​B>> toPair()
        A Map2 object that maps 2 values into a Pair object.
      • toTuple3

        @Deprecated
        public static <A,​B,​C> Map3<A,​B,​C,​Tuple3<A,​B,​C>> toTuple3()
        Deprecated.
        A Map3 object that maps 3 values to a Tuple3 object.
      • toTuple4

        @Deprecated
        public static <A,​B,​C,​D> Map4<A,​B,​C,​D,​Tuple4<A,​B,​C,​D>> toTuple4()
        Deprecated.
        A Map4 object that maps 4 values to a Tuple4 object.
      • toTuple5

        @Deprecated
        public static <A,​B,​C,​D,​E> Map5<A,​B,​C,​D,​E,​Tuple5<A,​B,​C,​D,​E>> toTuple5()
        Deprecated.
        A Map5 object that maps 5 values to a Tuple5 object.