Class StringListCommandParameter

  • All Implemented Interfaces:
    java.lang.Cloneable
    Direct Known Subclasses:
    CustomStringListCommandParameter

    public class StringListCommandParameter
    extends CommandParameter
    This class models a string list command parameter for Work-in-Progress, do not use!
    Author:
    bwolf
    • Constructor Summary

      Constructors 
      Constructor Description
      StringListCommandParameter​(java.lang.String id, java.lang.String des)
      constructor with identifier and description
    • Method Summary

      Modifier and Type Method Description
      java.lang.Object clone()
      method to clone this object for instantiation
      java.lang.String[] getValue()  
      CommandParameter instantiate​(java.lang.String s)
      instantiates unary argument if valid
      CommandParameter instantiate​(java.lang.String[] s)
      instantiates a list of arguments if valid
      boolean isValid​(java.lang.String s)
      checks each input string for validity
      void setValue​(java.lang.String[] value)  
      • Methods inherited from class java.lang.Object

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

      • StringListCommandParameter

        public StringListCommandParameter​(java.lang.String id,
                                          java.lang.String des)
        constructor with identifier and description
        Parameters:
        id - the identifier used to call this parameter
        des - the description of this parameter
    • Method Detail

      • getValue

        public java.lang.String[] getValue()
      • setValue

        public void setValue​(java.lang.String[] value)
      • isValid

        public boolean isValid​(java.lang.String s)
        checks each input string for validity
        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 unary argument if valid
        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.
      • instantiate

        public CommandParameter instantiate​(java.lang.String[] s)
        instantiates a list of arguments if valid
        Parameters:
        s - an array of strings
        Returns:
        the command parameter
      • clone

        public java.lang.Object clone()
        method to clone this object for instantiation