Class CustomStringListCommandParameter

  • All Implemented Interfaces:
    java.lang.Cloneable

    public class CustomStringListCommandParameter
    extends StringListCommandParameter
    This class extends the string list command parameter with functionality to define valid strings with regular expressions.
    Author:
    Bastian Wolf
    See Also:
    StringListCommandParameter
    • Constructor Summary

      Constructors 
      Constructor Description
      CustomStringListCommandParameter​(java.lang.String id, java.lang.String des)
      constructor for the custom string list parameter with id and description
      CustomStringListCommandParameter​(java.lang.String id, java.lang.String des, java.lang.String criteria)
      constructor for the custom string list parameter with id, description and criteria
    • Method Summary

      Modifier and Type Method Description
      java.lang.Object clone()
      method to clone this object for instantiation
      java.lang.String getCriteria()  
      java.lang.String[] getValue()  
      CommandParameter instantiate​(java.lang.String s)
      instantiate single string
      CommandParameter instantiate​(java.lang.String[] s)
      instantiates a list of arguments if valid
      boolean isValid​(java.lang.String s)
      valid iff string matches criteria
      void setCriteria​(java.lang.String criteria)  
      void setValue​(java.lang.String[] value)  
      • Methods inherited from class java.lang.Object

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

      • CustomStringListCommandParameter

        public CustomStringListCommandParameter​(java.lang.String id,
                                                java.lang.String des)
        constructor for the custom string list parameter with id and description
        Parameters:
        id - the identification string of this parameter
        des - the description of this parameter
      • CustomStringListCommandParameter

        public CustomStringListCommandParameter​(java.lang.String id,
                                                java.lang.String des,
                                                java.lang.String criteria)
        constructor for the custom string list parameter with id, description and criteria
        Parameters:
        id - the identification string of this parameter
        des - the description of this parameter
        criteria - the validation criteria for this parameter
    • Method Detail

      • getCriteria

        public java.lang.String getCriteria()
      • setCriteria

        public void setCriteria​(java.lang.String criteria)
      • isValid

        public boolean isValid​(java.lang.String s)
        valid iff string matches criteria
        Overrides:
        isValid in class StringListCommandParameter
        Parameters:
        s - the given input string
        Returns:
        true if valid, false if not
      • instantiate

        public CommandParameter instantiate​(java.lang.String[] s)
        instantiates a list of arguments if valid
        Overrides:
        instantiate in class StringListCommandParameter
        Parameters:
        s - the given strings array to instantiate
        Returns:
        instantiated parameter if input is valid,