Interface TryParser.Result<R extends @NonNull Object,T extends @NonNull Object>

Type Parameters:
R - The raw type.
T - The parsed type.
All Known Implementing Classes:
TryParser.Failure, TryParser.Success
Enclosing interface:
TryParser<R extends @NonNull Object,T extends @NonNull Object>

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

    Modifier and Type
    Method
    Description
    The error encountered in parsing, if any.
    The parsed item, if parsed successfully.
    raw()
    The raw value used in parsing.
  • Method Details

    • raw

      @Pure R raw()
      The raw value used in parsing.
      Returns:
      The raw value.
    • item

      @Pure @Nullable T 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.