Class ParseResult<T>
- java.lang.Object
-
- software.amazon.awssdk.codegen.jmespath.parser.ParseResult<T>
-
public final class ParseResult<T> extends Object
The result of aParser.parse(int, int)
call. This is either successful (success(T)
) or an error (error()
).
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T> ParseResult<T>
error()
Create an error result.boolean
hasResult()
Returns true if the parse result was successful.<U> ParseResult<U>
mapResult(Function<T,U> mapper)
Convert the value in this parse result (if successful) using the provided function.T
result()
Returns the result of parsing.static <T> ParseResult<T>
success(T result)
Create a successful result with the provided value.
-
-
-
Method Detail
-
success
public static <T> ParseResult<T> success(T result)
Create a successful result with the provided value.
-
error
public static <T> ParseResult<T> error()
Create an error result.
-
mapResult
public <U> ParseResult<U> mapResult(Function<T,U> mapper)
Convert the value in this parse result (if successful) using the provided function.
-
hasResult
public boolean hasResult()
Returns true if the parse result was successful.
-
result
public T result()
Returns the result of parsing.
-
-