Modifier and Type | Method and Description |
---|---|
static <E extends Throwable,T> |
exception(E exception)
Create
Result object with exception object |
E |
getException()
Return exception object if
Result object was created with one. |
T |
getResult()
Return valid result object if
Result object was created with one. |
T |
getResult(T defaultValue) |
T |
getResultThrowException() |
boolean |
hasException()
Test if
Result object holds an exception |
static <E extends Throwable,T> |
result(T result)
Create
Result object with valid result object |
public boolean hasException()
Result
object holds an exceptionResult
object holds an exceptionpublic T getResult()
Result
object was created with one.NoSuchElementException
- if Result
object was created with exceptionpublic E getException()
Result
object was created with one.NoSuchElementException
- if Result
object was created with valid resultpublic static <E extends Throwable,T> Result<E,T> result(T result)
Result
object with valid result objectE
- exception typeT
- valid result typeresult
- valid result objectResult
objectCopyright © 2020 Atlassian Software Systems Pty Ltd. All rights reserved.