public final class TryArr extends Object
Modifier and Type | Method | Description |
---|---|---|
boolean |
isFailure() |
Returns true if the parsed string is not a well-formed json array.
|
boolean |
isSuccess() |
Returns true if the parsed string is a well-formed json array.
|
JsArray |
orElse(Supplier<JsArray> other) |
Returns the computed JsArray if the parsed string is a well-formed json array, returning the
JsArray given by the supplier otherwise.
|
JsArray |
orElseThrow() |
Returns the computed JsArray if the parsed string is a well-formed json array, throwing a MalformedJson
otherwise.
|
Optional<JsArray> |
toOptional() |
Returns the computed JsArray wrapped in an optional if the parsed string is a well-formed json
array, returning an empty optional otherwise.
|
public boolean isFailure()
public boolean isSuccess()
public Optional<JsArray> toOptional()
public JsArray orElse(Supplier<JsArray> other)
other
- supplier to be executed if the parsed string is not a well-formed json arraypublic JsArray orElseThrow() throws MalformedJson
MalformedJson
- if the parsed string is not a well-formed json arrayCopyright © 2019. All rights reserved.