Class ResultUseRule
- java.lang.Object
-
- com.google.errorprone.bugpatterns.checkreturnvalue.ResultUseRule
-
- Direct Known Subclasses:
ResultUseRule.GlobalRule
,ResultUseRule.MethodRule
,ResultUseRule.SymbolRule
public abstract class ResultUseRule extends Object
A rule for determiningResultUsePolicy
for methods and/or constructors.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ResultUseRule.Evaluation
An evaluation that a rule makes.static class
ResultUseRule.GlobalRule
A global rule that is evaluated when none of the more specific rules determine aResultUsePolicy
for a method.static class
ResultUseRule.MethodRule
A rule that evaluates methods and constructors to determine aResultUsePolicy
for them.static class
ResultUseRule.RuleScope
Scope to which a rule may apply.static class
ResultUseRule.SymbolRule
A rule that evaluates symbols of any kind to determine aResultUsePolicy
to associate with them.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Optional<ResultUseRule.Evaluation>
evaluate(ResultUseRule.RuleScope scope, com.sun.tools.javac.code.Symbol symbol, VisitorState state)
Evaluates the given symbol and optionally returns anResultUseRule.Evaluation
of it.abstract Optional<ResultUsePolicy>
evaluate(com.sun.tools.javac.code.Symbol symbol, VisitorState state)
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.String
toString()
-
-
-
Method Detail
-
id
public abstract String id()
An ID for uniquely identifying this rule.
-
scopes
public abstract com.google.common.collect.ImmutableSet<ResultUseRule.RuleScope> scopes()
The scopes this rule applies to.
-
evaluate
public abstract Optional<ResultUsePolicy> evaluate(com.sun.tools.javac.code.Symbol symbol, VisitorState state)
Evaluates the givensymbol
and optionally returns aResultUsePolicy
for it.
-
evaluate
public final Optional<ResultUseRule.Evaluation> evaluate(ResultUseRule.RuleScope scope, com.sun.tools.javac.code.Symbol symbol, VisitorState state)
Evaluates the given symbol and optionally returns anResultUseRule.Evaluation
of it.
-
-