public class ConfigurationUtils
extends java.lang.Object
| Modifier and Type | Method and Description |
|---|---|
static boolean |
getBoolean(java.util.Map<java.lang.String,java.lang.String> settings,
java.lang.String name,
boolean defaultValue)
Convert value of this setting to a Java boolean (via
Boolean.parseBoolean(String)). |
static int |
getInt(java.util.Map<java.lang.String,java.lang.String> settings,
java.lang.String name)
Convert value of this setting to a Java int.
|
static int |
getInt(java.util.Map<java.lang.String,java.lang.String> settings,
java.lang.String name,
int defaultValue)
Convert value of this setting to a Java int.
|
static long |
getLong(java.util.Map<java.lang.String,java.lang.String> settings,
java.lang.String name,
long defaultValue)
Convert value of this setting to a Java long.
|
static java.lang.String |
getString(java.util.Map<java.lang.String,java.lang.String> settings,
java.lang.String name)
Convert value of this setting to a Java int.
|
static java.lang.String |
getString(java.util.Map<java.lang.String,java.lang.String> settings,
java.lang.String name,
java.lang.String defaultValue)
Return the value of the given property.
|
public static int getInt(java.util.Map<java.lang.String,java.lang.String> settings,
java.lang.String name)
throws java.lang.IllegalArgumentException
name - name of the setting / propertyjava.lang.IllegalArgumentException - if setting is not found or is not an integer.public static int getInt(java.util.Map<java.lang.String,java.lang.String> settings,
java.lang.String name,
int defaultValue)
throws java.lang.IllegalArgumentException
defaultValue is returned. If the property is not an int, an exception is thrown.name - name of the propertydefaultValue - default value if the property is not defined.defaultValue if the property is not defined.java.lang.IllegalArgumentException - if setting is not is not an integer.public static long getLong(java.util.Map<java.lang.String,java.lang.String> settings,
java.lang.String name,
long defaultValue)
throws java.lang.IllegalArgumentException
defaultValue is returned. If the property is not a long, an exception is thrown.name - name of the propertydefaultValue - default value if the property is not defined.defaultValue if the property is not defined.java.lang.IllegalArgumentException - if setting is not is not a long.public static boolean getBoolean(java.util.Map<java.lang.String,java.lang.String> settings,
java.lang.String name,
boolean defaultValue)
Boolean.parseBoolean(String)).
If the property is not found, the defaultValue is returned.name - name of the propertydefaultValue - default value if the property is not defined.defaultValue if the property is not defined.public static java.lang.String getString(java.util.Map<java.lang.String,java.lang.String> settings,
java.lang.String name)
throws java.lang.IllegalArgumentException
name - name of the propertyjava.lang.IllegalArgumentException - if setting is not found.public static java.lang.String getString(java.util.Map<java.lang.String,java.lang.String> settings,
java.lang.String name,
java.lang.String defaultValue)
defaultValue is returned.name - name of the propertydefaultValue - default value if the property is not defined.defaultValue if the property is not defined.Copyright © 2018. All Rights Reserved.