Class EvaluationResult
- java.lang.Object
-
- com.opengamma.strata.report.framework.expression.EvaluationResult
-
public final class EvaluationResult extends Object
The result of aTokenEvaluator
evaluating an expression against an object.The result contains the result of the evaluation and the remaining tokens in the expression.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EvaluationResult
failure(String message, Object... messageValues)
Creates a result for an unsuccessful evaluation of an expression.List<String>
getRemainingTokens()
Returns the tokens remaining in the expression after evaluation.Result<?>
getResult()
Returns the result of evaluating the expression against the object.boolean
isComplete()
Returns true if evaluation of the whole expression is complete.static EvaluationResult
of(Result<?> result, List<String> remainingTokens)
Creates the result of evaluating a token against an object.static EvaluationResult
success(Object value, List<String> remainingTokens)
Creates the result of successfully evaluating a token against an object.
-
-
-
Method Detail
-
success
public static EvaluationResult success(Object value, List<String> remainingTokens)
Creates the result of successfully evaluating a token against an object.- Parameters:
value
- the result of evaluating the expression against the objectremainingTokens
- the tokens remaining in the expression after evaluation- Returns:
- the result of successfully evaluating a token against an object
-
failure
public static EvaluationResult failure(String message, Object... messageValues)
Creates a result for an unsuccessful evaluation of an expression.- Parameters:
message
- the error messagemessageValues
- values substituted into the error message. SeeMessages.format(String, Object...)
for details- Returns:
- the result of an unsuccessful evaluation of an expression
-
of
public static EvaluationResult of(Result<?> result, List<String> remainingTokens)
Creates the result of evaluating a token against an object.- Parameters:
result
- the result of evaluating the expression against the objectremainingTokens
- the tokens remaining in the expression after evaluation- Returns:
- the result of evaluating a token against an object
-
getResult
public Result<?> getResult()
Returns the result of evaluating the expression against the object.- Returns:
- the result of evaluating the expression against the object
-
getRemainingTokens
public List<String> getRemainingTokens()
Returns the tokens remaining in the expression after evaluation.- Returns:
- the tokens remaining in the expression after evaluation
-
isComplete
public boolean isComplete()
Returns true if evaluation of the whole expression is complete.This occurs if the evaluation failed or all tokens in the expression have been consumed.
- Returns:
- returns true if evaluation of the whole expression is complete
-
-