Class MapUtil

java.lang.Object
com.github.toolarium.common.util.MapUtil

public final class MapUtil extends Object
Map utility.
  • Method Details

    • getInstance

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

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

      public <K, V> 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> Map<K,V> add(Map<K,V> map, 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