Class CommandParameter

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.lang.String description
      The description string for this parameter, e.g.
      private java.lang.String identifier
      The identifier string for the command parameter
    • Constructor Summary

      Constructors 
      Constructor Description
      CommandParameter​(java.lang.String id, java.lang.String des)
      non-empty constructor (member variables cannot be changed after construction)
    • Method Summary

      Modifier and Type Method Description
      java.lang.String getDescription()
      returns the description for this parameter
      java.lang.String getIdentifier()
      returns this parameters name (the identifier)
      abstract CommandParameter instantiate​(java.lang.String s)
      instantiate the command with the given argument string if valid
      abstract boolean isValid​(java.lang.String s)
      Checks, if the given String is a valid argument for this command parameter
      • Methods inherited from class java.lang.Object

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

      • identifier

        private java.lang.String identifier
        The identifier string for the command parameter
      • description

        private java.lang.String description
        The description string for this parameter, e.g. "-identifier , does magic with argument={simple, complex}"
    • Constructor Detail

      • CommandParameter

        public CommandParameter​(java.lang.String id,
                                java.lang.String des)
        non-empty constructor (member variables cannot be changed after construction)
        Parameters:
        id - the identifier string for this command parameter (e.g. aggr for aggregation)
        des - the description string for this command parameter
    • Method Detail

      • getIdentifier

        public java.lang.String getIdentifier()
        returns this parameters name (the identifier)
        Returns:
        this parameters name (the identifier)
      • getDescription

        public java.lang.String getDescription()
        returns the description for this parameter
        Returns:
        the description for this parameter
      • isValid

        public abstract boolean isValid​(java.lang.String s)
        Checks, if the given String is a valid argument for this command parameter
        Parameters:
        s - the given input string
        Returns:
        true if valid, false if not
      • instantiate

        public abstract CommandParameter instantiate​(java.lang.String s)
        instantiate the command with the given argument string if valid
        Parameters:
        s - the given argument string
        Returns:
        The CommandParameter instance or null if the given string is not valid.