Class TaskMetadataImpl

    • Field Detail

    • Constructor Detail

      • TaskMetadataImpl

        public TaskMetadataImpl()
        Creates a new TaskMetadataImpl object.
      • TaskMetadataImpl

        public TaskMetadataImpl​(java.lang.String desc)
        Creates a new TaskMetadataImpl object.
        Parameters:
        desc - The description for this task.
    • Method Detail

      • getDescription

        public java.lang.String getDescription()
        Description copied from interface: TaskMetadata
        Returns the textual description of the purpose of this Task.
        Specified by:
        getDescription in interface TaskMetadata
        Returns:
        The textual description of this Task.
      • getParameterCount

        public int getParameterCount()
        Description copied from interface: TaskMetadata
        Returns the number of parameters that this Task recognizes.
        Specified by:
        getParameterCount in interface TaskMetadata
        Returns:
        The number of parameters that this Task recognizes.
      • hasParameterMetadata

        public boolean hasParameterMetadata​(java.lang.String paramName)
        Description copied from interface: TaskMetadata
        Returns whether the metadata for a specific named Task parameter exists.
        Specified by:
        hasParameterMetadata in interface TaskMetadata
        Parameters:
        paramName - The name of the parameter to check for.
        Returns:
        Whether the metadata for a specific named Task parameter exists.
      • setDescription

        public void setDescription​(java.lang.String desc)
        Sets the description for this task.
        Parameters:
        desc - The description for this task.
      • getParameterMetadata

        public TaskParameterMetadata getParameterMetadata​(java.lang.String name,
                                                          boolean create)
        Gets a task parameter's metadata based on its name.
        Parameters:
        name - The name of the task parameter.
        create - Whether or not we should create one if it is absent.
        Returns:
        The TaskParameterMetadata for this parameter or null if non-existent and 'create' is false.
      • addParameterMetadata

        public TaskParameterMetadataImpl addParameterMetadata​(java.lang.String name,
                                                              java.lang.String desc,
                                                              boolean required,
                                                              java.lang.Object defValue)
        Adds a new metadata object for a task parameter.
        Parameters:
        name - The name of the task parameter.
        desc - The description of the task parameter.
        required - Whether the task is required or not.
        defValue - The default value if it is optional.
        Returns:
        The newly created TaskParameterMetadataImpl object. It has already been added to this task's collection.
      • addParameterMetadata

        public TaskParameterMetadataImpl addParameterMetadata​(java.lang.String name,
                                                              java.lang.String desc,
                                                              boolean required,
                                                              java.lang.Object defValue,
                                                              java.lang.String type,
                                                              java.lang.String validator)
        Adds a new metadata object for a task parameter.
        Parameters:
        name - The name of the task parameter.
        desc - The description of the task parameter.
        required - Whether the task is required or not.
        defValue - The default value if it is optional.
        type - The data type of the task parameter.
        validator - The validator to check whether the value for the parameter is valid.
        Returns:
        The newly created TaskParameterMetadataImpl object. It has already been added to this task's collection.
      • addParameterMetadata

        @Deprecated
        public TaskParameterMetadataImpl addParameterMetadata​(java.lang.String name,
                                                              java.lang.String desc,
                                                              boolean required,
                                                              java.lang.String defValue)
        Adds a new metadata object for a task parameter.
        Parameters:
        name - The name of the task parameter.
        desc - The description of the task parameter.
        required - Whether the task is required or not.
        defValue - The default value if it is optional.
        Returns:
        The newly created TaskParameterMetadataImpl object. It has already been added to this task's collection.
      • addParameterMetadata

        public void addParameterMetadata​(TaskParameterMetadataImpl paramMetadataImpl)
        Add the metadata object for a task parameter.
        Parameters:
        paramMetadataImpl - The TaskParameterMetadataImpl object for a specific task parameter.
      • allRequiredParametersPresent

        public boolean allRequiredParametersPresent​(RequestKeys requestKeys)
        Returns whether all required parameters are present.
        Parameters:
        requestKeys - The RequestKeys object that is inspected.
        Returns:
        True, if all required parameters are present; otherwise, false.
      • getMissingParameters

        public java.lang.String getMissingParameters​(RequestKeys requestKeys)
        Builds up a list of missing REQUIRED parameters.
        Parameters:
        requestKeys - The RequestKeys to inspect.
        Returns:
        A string of missing REQUIRED task parameters.