Package com.saperion.ngc.configuration
Class Parameter
- java.lang.Object
-
- com.saperion.ngc.configuration.Parameter
-
public class Parameter extends java.lang.ObjectA configuration parameter.
-
-
Constructor Summary
Constructors Constructor Description Parameter(java.lang.String name, java.lang.String rawValue)Creates a new parameter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanfound()booleangetBoolean()booleangetBoolean(boolean defaultBoolean)intgetInt()intgetInt(int defaultInteger)longgetLong()longgetLong(long defaultLong)java.lang.StringgetName()java.lang.StringgetString()java.lang.StringgetString(java.lang.String defaultString)
-
-
-
Method Detail
-
getName
public java.lang.String getName()
- Returns:
- the name of the parameter
-
found
public boolean found()
- Returns:
- true if a value for the parameter was found
-
getString
public java.lang.String 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
NumberFormatExceptionif the value cannot be parsed as int.
-
getLong
public long getLong()
- Returns:
- the value as long. Throws a
NumberFormatExceptionif the value cannot be parsed as long.
-
getString
public java.lang.String getString(java.lang.String defaultString)
- 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
-
-