Class AbstractParameterTool

    • Constructor Detail

      • AbstractParameterTool

        public AbstractParameterTool()
    • Method Detail

      • getUnrequestedParameters

        @PublicEvolving
        public Set<String> getUnrequestedParameters()
        Returns the set of parameter names which have not been requested with has(String) or one of the get methods. Access to the map returned by toMap() is not tracked.
      • getNumberOfParameters

        protected abstract int getNumberOfParameters()
        Returns number of parameters in AbstractParameterTool.
      • get

        protected abstract String get​(String key)
        Returns the String value for the given key. If the key does not exist it will return null.
      • has

        public abstract boolean has​(String value)
        Check if value is set.
      • getRequired

        public String getRequired​(String key)
        Returns the String value for the given key. If the key does not exist it will throw a RuntimeException.
      • get

        public String get​(String key,
                          String defaultValue)
        Returns the String value for the given key. If the key does not exist it will return the given default value.
      • getInt

        public int getInt​(String key)
        Returns the Integer value for the given key. The method fails if the key does not exist or the value is not an Integer.
      • getInt

        public int getInt​(String key,
                          int defaultValue)
        Returns the Integer value for the given key. If the key does not exists it will return the default value given. The method fails if the value is not an Integer.
      • getLong

        public long getLong​(String key)
        Returns the Long value for the given key. The method fails if the key does not exist.
      • getLong

        public long getLong​(String key,
                            long defaultValue)
        Returns the Long value for the given key. If the key does not exists it will return the default value given. The method fails if the value is not a Long.
      • getFloat

        public float getFloat​(String key)
        Returns the Float value for the given key. The method fails if the key does not exist.
      • getFloat

        public float getFloat​(String key,
                              float defaultValue)
        Returns the Float value for the given key. If the key does not exists it will return the default value given. The method fails if the value is not a Float.
      • getDouble

        public double getDouble​(String key)
        Returns the Double value for the given key. The method fails if the key does not exist.
      • getDouble

        public double getDouble​(String key,
                                double defaultValue)
        Returns the Double value for the given key. If the key does not exists it will return the default value given. The method fails if the value is not a Double.
      • getBoolean

        public boolean getBoolean​(String key)
        Returns the Boolean value for the given key. The method fails if the key does not exist.
      • getBoolean

        public boolean getBoolean​(String key,
                                  boolean defaultValue)
        Returns the Boolean value for the given key. If the key does not exists it will return the default value given. The method returns whether the string of the value is "true" ignoring cases.
      • getShort

        public short getShort​(String key)
        Returns the Short value for the given key. The method fails if the key does not exist.
      • getShort

        public short getShort​(String key,
                              short defaultValue)
        Returns the Short value for the given key. If the key does not exists it will return the default value given. The method fails if the value is not a Short.
      • getByte

        public byte getByte​(String key)
        Returns the Byte value for the given key. The method fails if the key does not exist.
      • getByte

        public byte getByte​(String key,
                            byte defaultValue)
        Returns the Byte value for the given key. If the key does not exists it will return the default value given. The method fails if the value is not a Byte.
      • addToDefaults

        protected void addToDefaults​(String key,
                                     String value)