Method Summary
All Methods Static Methods Concrete Methods
Reads the configuration from a Reader.
Converts properties into a map.
static void
Puts this property in the config if it has been set in any of these values.
static void
Puts this property in the config if it has been set in any of these values.
static void
Reports all remaining keys in config that start with prefix as unrecognised by throwing an
exception.
Returns the enum constant of this class with the specified name.
Returns an array containing the constants of this enum class, in
the order they are declared.
Methods inherited from class java.lang.Enum
clone , compareTo , describeConstable , equals , finalize , getDeclaringClass , hashCode , name , ordinal , toString , valueOf
Method Details
values
Returns an array containing the constants of this enum class, in
the order they are declared.
Returns:
an array containing the constants of this enum class, in the order they are declared
valueOf
Returns the enum constant of this class with the specified name.
The string must match exactly an identifier used to declare an
enum constant in this class. (Extraneous whitespace characters are
not permitted.)
Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum class has no constant with the specified name
NullPointerException - if the argument is null
loadConfiguration
Reads the configuration from a Reader.
Returns:
The properties from the configuration file. An empty Map if none.
Throws:
MigrateDbException - When the configuration could not be read.
propertiesToMap
Converts properties into a map.
putIfSet
Puts this property in the config if it has been set in any of these values.
Parameters:
config - The config.
key - The property name.
values - The values to try. The first non-null value will be set.
putArrayIfSet
Puts this property in the config if it has been set in any of these values.
Parameters:
config - The config.
key - The property name.
values - The values to try. The first non-null value will be set.
removeBoolean
Parameters:
config - The config.
key - The property name.
Returns:
The property value as a boolean if it exists, otherwise null.
Throws:
MigrateDbException - when the property value is not a valid boolean.
removeInteger
Parameters:
config - The config.
key - The property name.
Returns:
The property value as an integer if it exists, otherwise null.
Throws:
MigrateDbException - When the property value is not a valid integer.
reportUnrecognisedProperties
Reports all remaining keys in config that start with prefix as unrecognised by throwing an
exception. Does nothing if config is empty or none of its keys start with prefix.
Parameters:
prefix - The expected prefix for MigrateDB configuration parameters. null if none.