Class PropertiesConverter
java.lang.Object
org.springframework.batch.support.PropertiesConverter
Utility to convert a Properties object to a String and back. The format of properties
is new line separated key=value pairs.
- Author:
- Lucas Ward, Dave Syer, Mahmoud Ben Hassine
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
propertiesToString
(Properties propertiesToParse) Convert a Properties object to a String.static Properties
stringToProperties
(String stringToParse) Parse a String to a Properties object.
-
Method Details
-
stringToProperties
Parse a String to a Properties object. If string is empty, an empty Properties object will be returned. The input String should be a set of key=value pairs, separated by a new line.- Parameters:
stringToParse
- String to parse. Must not benull
.- Returns:
- Properties parsed from each key=value pair.
-
propertiesToString
Convert a Properties object to a String. This is only necessary for compatibility with converting the String back to a properties object. If an empty properties object is passed in, a blank string is returned, otherwise it's string representation is returned.- Parameters:
propertiesToParse
- contains the properties to be converted. Must not benull
.- Returns:
- String representation of the properties object
-