Class Parameter

java.lang.Object
com.saperion.ngc.configuration.Parameter

public class Parameter extends Object
A configuration parameter.
  • Constructor Details

    • Parameter

      public Parameter(String name, String rawValue)
      Creates a new parameter.
      Parameters:
      name - the parameter's name
      rawValue - the parameter's value as string
  • Method Details

    • getName

      public String getName()
      Returns:
      the name of the parameter
    • found

      public boolean found()
      Returns:
      true if a value for the parameter was found
    • getString

      public 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 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

      public String getString(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