Package org.h2.util
Class SortedProperties
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Object,
Object>
Sorted properties file.
This implementation requires that store() internally calls keys().
- See Also:
-
Field Summary
FieldsFields inherited from class java.util.Properties
defaults
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic SortedProperties
Convert a String to a map.static boolean
getBooleanProperty
(Properties prop, String key, boolean def) Get a boolean property value from a properties object.static int
getIntProperty
(Properties prop, String key, int def) Get an int property value from a properties object.static String
getStringProperty
(Properties prop, String key, String def) Get a string property value from a properties object.keys()
static SortedProperties
loadProperties
(String fileName) Load a properties object from a file.void
Store a properties file.toLines()
Convert the map to a list of line in the form key=value.Methods inherited from class java.util.Properties
clear, clone, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, get, getOrDefault, getProperty, getProperty, hashCode, isEmpty, keySet, list, list, load, load, loadFromXML, merge, propertyNames, put, putAll, putIfAbsent, rehash, remove, remove, replace, replace, replaceAll, save, setProperty, size, store, store, storeToXML, storeToXML, storeToXML, stringPropertyNames, toString, values
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
-
Constructor Details
-
SortedProperties
public SortedProperties()
-
-
Method Details
-
keys
- Overrides:
keys
in classProperties
-
getBooleanProperty
Get a boolean property value from a properties object.- Parameters:
prop
- the properties objectkey
- the keydef
- the default value- Returns:
- the value if set, or the default value if not
-
getIntProperty
Get an int property value from a properties object.- Parameters:
prop
- the properties objectkey
- the keydef
- the default value- Returns:
- the value if set, or the default value if not
-
getStringProperty
Get a string property value from a properties object.- Parameters:
prop
- the properties objectkey
- the keydef
- the default value- Returns:
- the value if set, or the default value if not
-
loadProperties
Load a properties object from a file.- Parameters:
fileName
- the name of the properties file- Returns:
- the properties object
- Throws:
IOException
- on failure
-
store
Store a properties file. The header and the date is not written.- Parameters:
fileName
- the target file name- Throws:
IOException
- on failure
-
toLines
Convert the map to a list of line in the form key=value.- Returns:
- the lines
-
fromLines
Convert a String to a map.- Parameters:
s
- the string- Returns:
- the map
-