Class ResultUseRule<C,S>
java.lang.Object
com.google.errorprone.bugpatterns.checkreturnvalue.ResultUseRule<C,S>
- Type Parameters:
C
- the type of the context object used during evaluationS
- the type of symbols
- Direct Known Subclasses:
ResultUseRule.GlobalRule
,ResultUseRule.MethodRule
,ResultUseRule.SymbolRule
A rule for determining
ResultUsePolicy
for methods and/or constructors.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
An evaluation that a rule makes.static class
A global rule that is evaluated when none of the more specific rules determine aResultUsePolicy
for a method.static class
ResultUseRule.MethodRule<C,
S, M extends S> A rule that evaluates methods and constructors to determine aResultUsePolicy
for them.static enum
Scope to which a rule may apply.static class
A rule that evaluates symbols of any kind to determine aResultUsePolicy
to associate with them. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal Optional
<ResultUseRule.Evaluation<S>> evaluate
(ResultUseRule.RuleScope scope, S symbol, C context) Evaluates the given symbol and optionally returns anResultUseRule.Evaluation
of it.abstract Optional
<ResultUsePolicy> Evaluates the givensymbol
and optionally returns aResultUsePolicy
for it.abstract String
id()
An ID for uniquely identifying this rule.abstract com.google.common.collect.ImmutableSet
<ResultUseRule.RuleScope> scopes()
The scopes this rule applies to.final String
toString()
-
Constructor Details
-
ResultUseRule
public ResultUseRule()
-
-
Method Details
-
id
An ID for uniquely identifying this rule. -
scopes
The scopes this rule applies to. -
evaluate
Evaluates the givensymbol
and optionally returns aResultUsePolicy
for it. -
evaluate
public final Optional<ResultUseRule.Evaluation<S>> evaluate(ResultUseRule.RuleScope scope, S symbol, C context) Evaluates the given symbol and optionally returns anResultUseRule.Evaluation
of it. -
toString
-