Interface AssessmentResultBuilder

    • Method Detail

      • end

        AssessmentResultBuilder end()
        Calling this method signals the end of the assessment.
        Returns:
        the same builder instance
      • addAssessmentTarget

        AssessmentResultBuilder addAssessmentTarget​(Document document)
        Allows the target of an assessment to be registered and tracked. This can be called multiple times for the same target without causing duplicate targets to be registered. It is expected that an Assessment will call this method at least once.
        Parameters:
        document - the target of the assessment
        Returns:
        the same builder instance
      • assignProperty

        AssessmentResultBuilder assignProperty​(String key,
                                               String value)
        Allows arbitrary assessment properties to be associated with the results. This can be used to include meta information in the assessment results produced.
        Parameters:
        key - the property key
        value - the property value
        Returns:
        this builder
      • addTestResult

        <DOC extends DocumentAssessmentResultBuilder addTestResult​(Assessment<? extends DOC> assessment,
                                                                     DOC document,
                                                                     String derivedRequirementId,
                                                                     TestResult result)
        Appends a new TestResult to the collection of test results associated with the provided derived requirement identifier.
        Type Parameters:
        DOC - the type of document that is the target of the assessment
        Parameters:
        assessment - the target assessment
        document - the document being assessed
        derivedRequirementId - the derived requirement that the test result is associated with
        result - the test result to append
        Returns:
        the same builder instance
      • assignTestStatus

        <DOC extends DocumentAssessmentResultBuilder assignTestStatus​(Assessment<? extends DOC> assessment,
                                                                        DOC document,
                                                                        String derivedRequirementId,
                                                                        TestState state)
        Marks the derived requirement associated with the provided identifier as having a specific TestState. This method is called when the addTestResult(Assessment, Document, String, TestResult) method is called. If no test result is reported for a given derived requirement, then this method needs to be called to indicate the actual test state of a derived requirement.
        Type Parameters:
        DOC - the type of document that is the target of the assessment
        Parameters:
        assessment - the target assessment
        document - the document being assessed
        derivedRequirementId - the derived requirement to set the state for
        state - the state to assign
        Returns:
        the current builder instance
      • build

        AssessmentResults build​(RequirementsManager requirementsManager)
        Generates a new AssessmentResults instance based on the previously recorded TestResult records and other statuses provided to the builder..

        Note: end() must be called before this method to terminate the assessment.

        Parameters:
        requirementsManager - the set of requirements corresponding to the assessments performed
        Returns:
        a new assessment result instance
        Throws:
        IllegalStateException - if the end() method hasn't first been called
      • getLoggingHandler

        LoggingHandler getLoggingHandler()
        Retrieves a handler that is used to process various assessment event callback methods.
        Returns:
        a non-null handler instance
      • setLoggingHandler

        void setLoggingHandler​(LoggingHandler handler)