Package org.h2.util
Class SortedProperties
- java.lang.Object
-
- java.util.Dictionary<K,V>
-
- java.util.Hashtable<java.lang.Object,java.lang.Object>
-
- java.util.Properties
-
- org.h2.util.SortedProperties
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,java.util.Map<java.lang.Object,java.lang.Object>
public class SortedProperties extends java.util.PropertiesSorted properties file. This implementation requires that store() internally calls keys().- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description private static longserialVersionUID
-
Constructor Summary
Constructors Constructor Description SortedProperties()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static SortedPropertiesfromLines(java.lang.String s)Convert a String to a map.static booleangetBooleanProperty(java.util.Properties prop, java.lang.String key, boolean def)Get a boolean property value from a properties object.static intgetIntProperty(java.util.Properties prop, java.lang.String key, int def)Get an int property value from a properties object.static java.lang.StringgetStringProperty(java.util.Properties prop, java.lang.String key, java.lang.String def)Get a string property value from a properties object.java.util.Enumeration<java.lang.Object>keys()static SortedPropertiesloadProperties(java.lang.String fileName)Load a properties object from a file.voidstore(java.lang.String fileName)Store a properties file.java.lang.StringtoLines()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 Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
-
Method Detail
-
keys
public java.util.Enumeration<java.lang.Object> keys()
- Overrides:
keysin classjava.util.Properties
-
getBooleanProperty
public static boolean getBooleanProperty(java.util.Properties prop, java.lang.String key, boolean def)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
public static int getIntProperty(java.util.Properties prop, java.lang.String key, int def)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
public static java.lang.String getStringProperty(java.util.Properties prop, java.lang.String key, java.lang.String def)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
public static SortedProperties loadProperties(java.lang.String fileName) throws java.io.IOException
Load a properties object from a file.- Parameters:
fileName- the name of the properties file- Returns:
- the properties object
- Throws:
java.io.IOException- on failure
-
store
public void store(java.lang.String fileName) throws java.io.IOExceptionStore a properties file. The header and the date is not written.- Parameters:
fileName- the target file name- Throws:
java.io.IOException- on failure
-
toLines
public java.lang.String toLines()
Convert the map to a list of line in the form key=value.- Returns:
- the lines
-
fromLines
public static SortedProperties fromLines(java.lang.String s)
Convert a String to a map.- Parameters:
s- the string- Returns:
- the map
-
-