Class Result
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.rules.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 Summary
Fields Modifier and Type Field Description static double
FAILED
static double
IGNORE
private static double
IN_PROGRESS
private java.lang.String
longDescription
static double
NOT_APPLICABLE
Magic numbers for specific cases where an IRule returns a Result without a scoreprivate IItemQuery
query
private IRule
rule
private double
score
private java.lang.String
shortDescription
-
Constructor Summary
Constructors Constructor Description Result(IRule rule, double score, java.lang.String shortDescription)
Result(IRule rule, double score, java.lang.String shortDescription, java.lang.String longDescription)
Result(IRule rule, double score, java.lang.String shortDescription, java.lang.String longDescription, IItemQuery query)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IItemQuery
getItemQuery()
java.lang.String
getLongDescription()
IRule
getRule()
The rule which generated this result.double
getScore()
A score between 0 and 100 where 0 means "no problem" and 100 means "big problem".java.lang.String
getShortDescription()
private boolean
isValidScore(double score)
java.lang.String
toString()
-
-
-
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
-
FAILED
public static final double FAILED
- See Also:
- Constant Field Values
-
IGNORE
public static final double IGNORE
- See Also:
- Constant Field Values
-
IN_PROGRESS
private static final double IN_PROGRESS
- 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
-
query
private final IItemQuery query
-
-
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 intoSeverity.get(double)
to get a matchingSeverity
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 classjava.lang.Object
-
-