Package com.saperion.ngc.configuration
Class Parameter
java.lang.Object
com.saperion.ngc.configuration.Parameter
A configuration parameter.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
Parameter
Creates a new parameter.- Parameters:
name
- the parameter's namerawValue
- the parameter's value as string
-
-
Method Details
-
getName
- Returns:
- the name of the parameter
-
found
public boolean found()- Returns:
- true if a value for the parameter was found
-
getString
- Returns:
- the value as string
-
getBoolean
public boolean getBoolean()- Returns:
- the value as boolean
-
getInt
public int getInt()- Returns:
- the value as int. Throws a
NumberFormatException
if the value cannot be parsed as int.
-
getLong
public long getLong()- Returns:
- the value as long. Throws a
NumberFormatException
if the value cannot be parsed as long.
-
getString
- Parameters:
defaultString
- the value to return if no value was found in the configuration- Returns:
- the value as string or the default value if the parameter was not found
-
getBoolean
public boolean getBoolean(boolean defaultBoolean) - Parameters:
defaultBoolean
- the value to return if no value was found in the configuration- Returns:
- the value as boolean or the default value if the parameter was not found
-
getInt
public int getInt(int defaultInteger) - Parameters:
defaultInteger
- the value to return if no value was found in the configuration- Returns:
- the value as int or the default value if the parameter was not found
-
getLong
public long getLong(long defaultLong) - Parameters:
defaultLong
- the value to return if no value was found in the configuration- Returns:
- the value as long or the default value if the parameter was not found
-