Class Result<T,E>
java.lang.Object
blazing.types.Result<T,E>
- Type Parameters:
T- The type of the expression stored in resultE- The type of the error that is returned
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T,E> Result <T, E> err(E value) Used to represent an errorbooleanisErr()Checks if the value is an errorbooleanisOk()Checks if the value is okstatic <T,E> Result <T, E> ok(T value) Used to represent a successful resultunwrap()Unwraps the Ok value and panics if there is an errorUnwraps the error and panics if the value is OkUnwraps an Ok value and returns the provided value if there is an errorunwrapOrElse(Supplier<T> fx) Unwraps an Ok value and calls the supplier method if there is an error
-
Method Details
-
ok
Used to represent a successful result- Type Parameters:
T-E-- Parameters:
value-- Returns:
-
err
Used to represent an error- Type Parameters:
T-E-- Parameters:
value-- Returns:
-
unwrap
-
unwrapOr
-
unwrapOrElse
-
unwrapErr
-
isErr
public boolean isErr()Checks if the value is an error- Returns:
-
isOk
public boolean isOk()Checks if the value is ok- Returns:
-