Class Result
- java.lang.Object
-
- org.openjdk.jmc.flightrecorder.rules.Result
-
public final class Result extends java.lang.ObjectA 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 doubleFAILEDstatic doubleIGNOREprivate static doubleIN_PROGRESSprivate java.lang.StringlongDescriptionstatic doubleNOT_APPLICABLEMagic numbers for specific cases where an IRule returns a Result without a scoreprivate IItemQueryqueryprivate IRuleruleprivate doublescoreprivate java.lang.StringshortDescription
-
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 IItemQuerygetItemQuery()java.lang.StringgetLongDescription()IRulegetRule()The rule which generated this result.doublegetScore()A score between 0 and 100 where 0 means "no problem" and 100 means "big problem".java.lang.StringgetShortDescription()private booleanisValidScore(double score)java.lang.StringtoString()
-
-
-
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:
trueif 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)falseotherwise
-
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 matchingSeverityvalue.- 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
nullif no long description is provided.
-
getItemQuery
public IItemQuery getItemQuery()
- Returns:
- the query of the result
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-