Class IntegerCommandParameter

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class IntegerCommandParameter
    extends CommandParameter
    This parameter holds a number-interval of possible arguments
    Author:
    Bastian Wolf
    • Method Summary

      Modifier and Type Method Description
      java.lang.Object clone()
      Clones the object
      Interval<java.lang.Integer> getInterval()
      returns each possible selection argument
      java.lang.Integer getValue()
      returns the given instantiation argument value for this parameter
      CommandParameter instantiate​(java.lang.String s)
      instantiates a new parameter iff the given value is valid for this command parameter
      boolean isValid​(java.lang.String s)
      checks whether a cli input parameter argument is valid for the called command parameter
      void setInterval​(java.lang.String interval)
      sets new selection parameter
      void setValue​(java.lang.Integer value)
      sets the instantiated parameter argument value, value has to be one of the options contained in selections
      • Methods inherited from class java.lang.Object

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

      • IntegerCommandParameter

        public IntegerCommandParameter​(java.lang.String id,
                                       java.lang.String des)
      • IntegerCommandParameter

        public IntegerCommandParameter​(java.lang.String id,
                                       java.lang.String des,
                                       Interval<java.lang.Integer> interval)
      • IntegerCommandParameter

        public IntegerCommandParameter​(java.lang.String id,
                                       java.lang.String des,
                                       java.lang.String interval)
    • Method Detail

      • setInterval

        public void setInterval​(java.lang.String interval)
        sets new selection parameter
        Parameters:
        interval - some string
      • getInterval

        public Interval<java.lang.Integer> getInterval()
        returns each possible selection argument
        Returns:
        each possible selection argument
      • getValue

        public java.lang.Integer getValue()
        returns the given instantiation argument value for this parameter
        Returns:
        the given instantiation argument value for this parameter
      • setValue

        public void setValue​(java.lang.Integer value)
        sets the instantiated parameter argument value, value has to be one of the options contained in selections
        Parameters:
        value - the value given as argument value
      • isValid

        public boolean isValid​(java.lang.String s)
        checks whether a cli input parameter argument is valid for the called command parameter
        Specified by:
        isValid in class CommandParameter
        Parameters:
        s - the given input string
        Returns:
        true if valid, false if not
      • instantiate

        public CommandParameter instantiate​(java.lang.String s)
        instantiates a new parameter iff the given value is valid for this command parameter
        Specified by:
        instantiate in class CommandParameter
        Parameters:
        s - the given argument string
        Returns:
        The CommandParameter instance or null if the given string is not valid.
      • clone

        public java.lang.Object clone()
        Clones the object