Class MapUtils

java.lang.Object
com.clickhouse.client.api.internal.MapUtils

public class MapUtils extends Object
Collection of utility methods for working with maps.
  • Constructor Details

    • MapUtils

      public MapUtils()
  • Method Details

    • applyLong

      public static void applyLong(Map<String,String> map, String key, Consumer<Long> consumer)
    • applyInt

      public static void applyInt(Map<String,String> map, String key, Consumer<Integer> consumer)
    • getInt

      public static int getInt(Map<String,String> map, String key)
    • getLong

      public static long getLong(Map<String,String> map, String key)
    • getFlag

      public static boolean getFlag(Map<String,String> map, String key)
      Get a boolean value from a map.
      Parameters:
      map - map to get value from
      key - key to get value for
      Returns:
      boolean value
      Throws:
      NullPointerException - if the key is missing
      IllegalArgumentException - if the value is not a boolean
    • getFlag

      public static boolean getFlag(Map<String,?> map, String key, boolean defaultValue)
      Get a boolean value from a map.
      Parameters:
      map - - configuration map
      key - - key of the property
      defaultValue - - value if not found
      Returns:
      boolean value
    • getFlag

      public static boolean getFlag(Map<String,?> p1, Map<String,?> p2, String key)
      Get a boolean value from a p1, if not found, get from p2.
      Parameters:
      p1 - - first map
      p2 - - second map
      key - - key of the property
      Returns:
      boolean value
      Throws:
      NullPointerException - if the key is missing in both maps