Class CommandResponse


  • public class CommandResponse
    extends Object
    A response from running a Command.
    • Constructor Detail

      • CommandResponse

        public CommandResponse​(String command)
        Creates a new response with no error string.
        Parameters:
        command - command name
      • CommandResponse

        public CommandResponse​(String command,
                               String error)
        Creates a new response.
        Parameters:
        command - command name
        error - error string (may be null)
    • Method Detail

      • getCommand

        public String getCommand()
        Gets the command name.
        Returns:
        command name
      • getError

        public String getError()
        Gets the error string (may be null).
        Returns:
        error string
      • put

        public Object put​(String key,
                          Object value)
        Adds a key/value pair to this response.
        Parameters:
        key - key
        value - value
        Returns:
        prior value for key, or null if none
      • putAll

        public void putAll​(Map<? extends String,​?> m)
        Adds all key/value pairs in the given map to this response.
        Parameters:
        m - map of key/value pairs
      • toMap

        public Map<String,​Object> toMap()
        Converts this response to a map. The returned map is mutable, and changes to it do not reflect back into this response.
        Returns:
        map representation of response