- Type Parameters:
R
- The raw type.T
- The parsed type.
- All Known Implementing Classes:
TryParser.Failure
,TryParser.Success
public static sealed interface TryParser.Result<R extends @NonNull Object,T extends @NonNull Object>
permits TryParser.Success<R,T>, TryParser.Failure<R,T>
The result of parsing.
Note that, for a given instance, exactly one of item()
or error()
will return null
.
- Since:
- 1.0
-
Method Summary
-
Method Details
-
raw
The raw value used in parsing.- Returns:
- The raw value.
-
item
The parsed item, if parsed successfully.- Returns:
- The parsed item, or
null
if the item was invalid.
-
error
The error encountered in parsing, if any.- Returns:
- The error, or
null
if the item was parsed successfully.
-