Class ResultUsePolicyEvaluator<C,S,M extends S>
java.lang.Object
com.google.errorprone.bugpatterns.checkreturnvalue.ResultUsePolicyEvaluator<C,S,M>
- Type Parameters:
C
- the type of the context object used during evaluationS
- the type of symbolsM
- the type of method symbols
public final class ResultUsePolicyEvaluator<C,S,M extends S> extends Object
Evaluates methods and their enclosing classes and packages to determine a
ResultUsePolicy
for the methods.-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ResultUsePolicyEvaluator.Builder<C,S,M extends S>
Builder forResultUsePolicyEvaluator
.static interface
ResultUsePolicyEvaluator.MethodInfo<C,S,M extends S>
Delegate to return information about a method symbol. -
Method Summary
Modifier and Type Method Description static <C, S, M extends S>
ResultUsePolicyEvaluator.Builder<C,S,M>builder(ResultUsePolicyEvaluator.MethodInfo<C,S,M> methodInfo)
Returns a newResultUsePolicyEvaluator.Builder
for creating aResultUsePolicyEvaluator
.ResultUsePolicy
evaluate(M method, C state)
Evaluates the givenmethod
and returns a singleResultUsePolicy
that should apply to it.Stream<ResultUseRule.Evaluation<S>>
evaluations(M method, C state)
Returns a stream ofResultUseRule.Evaluation
s made by rules starting from the givenmethod
.
-
Method Details
-
builder
public static <C, S, M extends S> ResultUsePolicyEvaluator.Builder<C,S,M> builder(ResultUsePolicyEvaluator.MethodInfo<C,S,M> methodInfo)Returns a newResultUsePolicyEvaluator.Builder
for creating aResultUsePolicyEvaluator
.- Type Parameters:
C
- the type of the context object used during evaluationS
- the type of symbolsM
- the type of method symbols
-
evaluate
Evaluates the givenmethod
and returns a singleResultUsePolicy
that should apply to it. -
evaluations
Returns a stream ofResultUseRule.Evaluation
s made by rules starting from the givenmethod
.
-