Package org.h2.util

# Class SortedProperties

java.lang.Object
java.util.Dictionary<Object,Object>
java.util.Hashtable<Object,Object>
java.util.Properties
org.h2.util.SortedProperties

All Implemented Interfaces:
  `Serializable`, `Cloneable`, `Map<Object,Object>`

public class SortedProperties extends Properties
Sorted properties file. This implementation requires that store() internally calls keys().

See Also:
  - Serialized Form

## Field Summary

### Fields inherited from class java.util.Properties

`defaults`

## Constructor Summary

Constructors
Constructor
Description
`SortedProperties()`

## Method Summary

Modifier and Type
Method
Description
`static SortedProperties`
`fromLines(String s)`
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.
`Enumeration<Object>`
`keys()`
`static SortedProperties`
`loadProperties(String fileName)`
Load a properties object from a file.
`void`
`store(String fileName)`
Store a properties file.
`String`
`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`

### Methods inherited from class java.lang.Object

`finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### SortedProperties

public SortedProperties()

## Method Details

### keys

public Enumeration<Object> keys()

Overrides:
  `keys` in class `Properties`

### getBooleanProperty

public static boolean getBooleanProperty(Properties prop, String key, boolean def)
Get a boolean property value from a properties object.

Parameters:
  `prop` - the properties object
  `key` - the key
  `def` - the default value
Returns:
  the value if set, or the default value if not

### getIntProperty

public static int getIntProperty(Properties prop, String key, int def)
Get an int property value from a properties object.

Parameters:
  `prop` - the properties object
  `key` - the key
  `def` - the default value
Returns:
  the value if set, or the default value if not

### getStringProperty

public static String getStringProperty(Properties prop, String key, String def)
Get a string property value from a properties object.

Parameters:
  `prop` - the properties object
  `key` - the key
  `def` - the default value
Returns:
  the value if set, or the default value if not

### loadProperties

public static SortedProperties loadProperties(String fileName) throws IOException
Load a properties object from a file.

Parameters:
  `fileName` - the name of the properties file
Returns:
  the properties object
Throws:
  `IOException` - on failure

### store

public void store(String fileName) throws IOException
Store a properties file. The header and the date are not written.

Parameters:
  `fileName` - the target file name
Throws:
  `IOException` - on failure

### toLines

public String toLines()
Convert the map to a list of line in the form key=value.

Returns:
  the lines

### fromLines

public static SortedProperties fromLines(String s)
Convert a String to a map.

Parameters:
  `s` - the string
Returns:
  the map