Class MapUtil


  • public final class MapUtil
    extends java.lang.Object
    Map utility.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      <K,​V>
      java.util.Map<K,​V>
      add​(java.util.Map<K,​V> map, java.util.Map<K,​V> mapToAdd)
      Add a map
      static MapUtil getInstance()
      Get the instance
      <K,​V>
      java.util.Map<K,​V>
      newMap()
      Create a new map
      <K,​V>
      java.util.Map<K,​V>
      newMap​(boolean sorted)
      Create a new map
      • Methods inherited from class java.lang.Object

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

      • getInstance

        public static MapUtil getInstance()
        Get the instance
        Returns:
        the instance
      • newMap

        public <K,​V> java.util.Map<K,​V> newMap()
        Create a new map
        Type Parameters:
        K - the key
        V - the value
        Returns:
        the created map
      • newMap

        public <K,​V> java.util.Map<K,​V> newMap​(boolean sorted)
        Create a new map
        Type Parameters:
        K - the key
        V - the value
        Parameters:
        sorted - true if it is a sorted map
        Returns:
        the created map
      • add

        public <K,​V> java.util.Map<K,​V> add​(java.util.Map<K,​V> map,
                                                        java.util.Map<K,​V> mapToAdd)
        Add a map
        Type Parameters:
        K - the key
        V - the value
        Parameters:
        map - the map to extend
        mapToAdd - the added map
        Returns:
        the extended map