Class Result


  • public final class Result
    extends java.lang.Object
    A result from evaluating a rule. It contains a score value that shows how severe the result should be considered, text descriptions that can be used to tell the user about found problems (and possible solutions), and a query that can be used to identify specific data items related to the result.
    • Field Detail

      • NOT_APPLICABLE

        public static final double NOT_APPLICABLE
        Magic numbers for specific cases where an IRule returns a Result without a score
        See Also:
        Constant Field Values
      • rule

        private final IRule rule
      • score

        private final double score
      • shortDescription

        private final java.lang.String shortDescription
      • longDescription

        private final java.lang.String longDescription
    • Constructor Detail

      • Result

        public Result​(IRule rule,
                      double score,
                      java.lang.String shortDescription)
      • Result

        public Result​(IRule rule,
                      double score,
                      java.lang.String shortDescription,
                      java.lang.String longDescription)
      • Result

        public Result​(IRule rule,
                      double score,
                      java.lang.String shortDescription,
                      java.lang.String longDescription,
                      IItemQuery query)
    • Method Detail

      • isValidScore

        private boolean isValidScore​(double score)
        Parameters:
        score - the score to validate
        Returns:
        true if score is in interval 0.0 <= score <= 100.0 or if it is one of the defined magic numbers (including -200 for JMC UI purposes) false otherwise
      • getRule

        public IRule getRule()
        The rule which generated this result.
        Returns:
        the rule creating this result
      • getScore

        public double getScore()
        A score between 0 and 100 where 0 means "no problem" and 100 means "big problem". A score below zero means that the rule could not perform the evaluation for some reason. The score can be passed into Severity.get(double) to get a matching Severity value.
        Returns:
        the score for this result
      • getShortDescription

        public java.lang.String getShortDescription()
        Returns:
        a short text message describing the result
      • getLongDescription

        public java.lang.String getLongDescription()
        Returns:
        A longer text message describing the result. Can be null if no long description is provided.
      • getItemQuery

        public IItemQuery getItemQuery()
        Returns:
        the query of the result
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object