Package main.utils.iocontrol
Class StringAndMapConvertor
java.lang.Object
main.utils.iocontrol.StringAndMapConvertor
The StringAndMapConvertor class provides methods to convert a String representation of a map to a Map object,
and vice versa.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
mapToString
(Map<String, String> map) Converts a Map object to a String representation of the map.stringToMap
(String string) Converts a String representation of a map to a Map object.
-
Constructor Details
-
StringAndMapConvertor
public StringAndMapConvertor()
-
-
Method Details
-
stringToMap
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
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.
-