Class Parameter


  • public class Parameter
    extends java.lang.Object
    A 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
      boolean found()  
      boolean getBoolean()  
      boolean getBoolean​(boolean defaultBoolean)  
      int getInt()  
      int getInt​(int defaultInteger)  
      long getLong()  
      long getLong​(long defaultLong)  
      java.lang.String getName()  
      java.lang.String getString()  
      java.lang.String getString​(java.lang.String defaultString)  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Parameter

        public Parameter​(java.lang.String name,
                         java.lang.String rawValue)
        Creates a new parameter.
        Parameters:
        name - the parameter's name
        rawValue - the parameter's value as string
    • 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 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 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