Interface IResult


  • public interface IResult
    Interface specifying result objects for use with IRule implementations. The default use is to use ResultBuilder, but this interface exists to allow further customization by downstream users.
    • Method Detail

      • getSeverity

        Severity getSeverity()
        Returns an enum of type Severity describing the importance of this result.
        Returns:
        a Severity describing the result
      • getRule

        IRule getRule()
        Returns the IRule that generated this result object.
        Returns:
        the IRule that generated this result
      • getSummary

        String getSummary()
        A short, one sentence, summary of the results of the rule evaluation. This is intended to give a very quick overview of what the rule detected. If the severity is OK or NA this should not be expected to contain any information, but it may. If the severity is INFO or WARNING this is expected to provide a very short summary of the found problem.
        Returns:
        a short text describing the findings of the rule
      • getExplanation

        String getExplanation()
        A more detailed explanation of what kind of problem was identified and why the identified issue is a problem. This field is always optional, but when it exists it may be very long and detailed.
        Returns:
        a detailed explanation of why and how the result is relevant
      • getSolution

        String getSolution()
        An attempted solution for the identified problem. This field is always optional, but if included it can e.g. specify new JVM flags or suggest changes in the source code.
        Returns:
        a text describing a possible solution for the found problem
      • suggestRecordingSettings

        Collection<IRecordingSetting> suggestRecordingSettings()
        An optional field potentially used for rules that have a set of recording settings that may help the rule return more detailed information.
        Returns:
        a set of recording settings
      • getResult

        <T> Collection<T> getResult​(TypedCollectionResult<T> result)
        Returns a collection of typed instances of a result contained in this result instance, i.e. is contained in IRule.getResults().
        Type Parameters:
        T - a type parameter
        Parameters:
        result - the typed result that is to be retrieved
        Returns:
        a typed result instance
      • getPreference

        <T> T getPreference​(TypedPreference<T> preference)
        Returns a preference value that was used when evaluating the rule for this particular result.
        Type Parameters:
        T - a type parameter
        Parameters:
        preference - a preference used by this rule, i.e. contained in IRule.getConfigurationAttributes()
        Returns:
        a preference value
      • getResult

        <T> T getResult​(TypedResult<T> result)
        Returns a typed instance of a result contained in this result instance, i.e. is contained in IRule.getResults().
        Type Parameters:
        T - a type parameter
        Parameters:
        result - the typed result that is to be retrieved
        Returns:
        a typed result instance