Class MapUtil

java.lang.Object
com.github.tadukoo.util.map.MapUtil

public final class MapUtil extends Object
Util functions for dealing with Maps.
Version:
Alpha v.0.2
Author:
Logan Ferree (Tadukoo)
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    Not allowed to make a MapUtil
  • Method Summary

    Modifier and Type
    Method
    Description
    static <K, V> Map<K,V>
    createMap(Pair<K,V>... entries)
    Creates a Map (specifically a HashMap) populated with the given entries.
    static boolean
    isBlank(Map<?,?> map)
    Checks if the given Map is blank (either null or an empty map).
    static boolean
    isNotBlank(Map<?,?> map)
    Checks if the given Map is NOT blank (blank = either null or an empty map).

    Methods inherited from class java.lang.Object

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

    • MapUtil

      private MapUtil()
      Not allowed to make a MapUtil
  • Method Details

    • isBlank

      public static boolean isBlank(Map<?,?> map)
      Checks if the given Map is blank (either null or an empty map).
      Parameters:
      map - The Map to check
      Returns:
      true if the Map is null or empty
    • isNotBlank

      public static boolean isNotBlank(Map<?,?> map)
      Checks if the given Map is NOT blank (blank = either null or an empty map).
      Parameters:
      map - The Map to check
      Returns:
      true if the Map is not null and not empty
    • createMap

      @SafeVarargs public static <K, V> Map<K,V> createMap(Pair<K,V>... entries)
      Creates a Map (specifically a HashMap) populated with the given entries.
      Type Parameters:
      K - The key type of the map
      V - The value type of the map
      Parameters:
      entries - Key-Value Pairs to be put in the Map
      Returns:
      A newly created map populated with the given entries