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
Nested ClassesModifier and TypeClassDescriptionstatic classAn evaluation that a rule makes.static classA global rule that is evaluated when none of the more specific rules determine aResultUsePolicyfor a method.static classResultUseRule.MethodRule<C, S, M extends S>A rule that evaluates methods and constructors to determine aResultUsePolicyfor them.static enumScope to which a rule may apply.static classA rule that evaluates symbols of any kind to determine aResultUsePolicyto associate with them. -
Constructor Summary
Constructors -
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.Evaluationof it.abstract Optional<ResultUsePolicy> Evaluates the givensymboland optionally returns aResultUsePolicyfor it.abstract Stringid()An ID for uniquely identifying this rule.abstract com.google.common.collect.ImmutableSet<ResultUseRule.RuleScope> scopes()The scopes this rule applies to.final StringtoString()
-
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 givensymboland optionally returns aResultUsePolicyfor it. -
evaluate
public final Optional<ResultUseRule.Evaluation<S>> evaluate(ResultUseRule.RuleScope scope, S symbol, C context) Evaluates the given symbol and optionally returns anResultUseRule.Evaluationof it. -
toString
-