Class StringAndMapConvertor

java.lang.Object
main.utils.iocontrol.StringAndMapConvertor

public class StringAndMapConvertor extends Object
The StringAndMapConvertor class provides methods to convert a String representation of a map to a Map object, and vice versa.
  • Constructor Details

    • StringAndMapConvertor

      public StringAndMapConvertor()
  • Method Details

    • stringToMap

      public static Map<String,String> stringToMap(String string)
      Converts a String representation of a map to a Map object.
      Parameters:
      string - The String representation of the map.
      Returns:
      A Map object containing the key-value pairs from the String representation.
      Throws:
      IllegalArgumentException - if the input string contains invalid key-value pairs.
    • mapToString

      public static String mapToString(Map<String,String> map)
      Converts a Map object to a String representation of the map.
      Parameters:
      map - The Map object to convert.
      Returns:
      A String representation of the map.