Interface IResult
-
public interface IResult
Interface specifying result objects for use withIRule
implementations. The default use is to useResultBuilder
, but this interface exists to allow further customization by downstream users.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getExplanation()
A more detailed explanation of what kind of problem was identified and why the identified issue is a problem.<T> T
getPreference(TypedPreference<T> preference)
Returns a preference value that was used when evaluating the rule for this particular result.<T> Collection<T>
getResult(TypedCollectionResult<T> result)
Returns a collection of typed instances of a result contained in this result instance, i.e.<T> T
getResult(TypedResult<T> result)
Returns a typed instance of a result contained in this result instance, i.e.IRule
getRule()
Returns theIRule
that generated this result object.Severity
getSeverity()
Returns an enum of typeSeverity
describing the importance of this result.String
getSolution()
An attempted solution for the identified problem.String
getSummary()
A short, one sentence, summary of the results of the rule evaluation.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.
-
-
-
Method Detail
-
getSeverity
Severity getSeverity()
Returns an enum of typeSeverity
describing the importance of this result.- Returns:
- a Severity describing the result
-
getRule
IRule getRule()
Returns theIRule
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 isOK
orNA
this should not be expected to contain any information, but it may. If the severity isINFO
orWARNING
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 inIRule.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 inIRule.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 inIRule.getResults()
.- Type Parameters:
T
- a type parameter- Parameters:
result
- the typed result that is to be retrieved- Returns:
- a typed result instance
-
-