java.lang.Object
org.shredzone.acme4j.toolbox.JSON.Value
- Enclosing class:
- JSON
A single JSON value. This instance also covers
null values.
All return values are never null unless specified otherwise. For optional
parameters, use optional().
-
Method Summary
Modifier and TypeMethodDescriptionasArray()Returns the value asJSON.Array.byte[]asBinary()Returns the value as base64 decoded byte array.booleanReturns the value as boolean.Returns the value asDuration.Returns the value as JSON object that was Base64 URL encoded.Returns the value asIdentifier.Returns the value asInstant.intasInt()Returns the value as int.asObject()Returns the value as JSON object.Returns the value asProblem.asStatus()Returns the parsedStatus.asString()Returns the value asString.asURI()Returns the value asURI.asURL()Returns the value asURL.booleaninthashCode()booleanChecks if this value isnull.<T> Optional<T>map(Function<JSON.Value, T> mapper) Returns this value as anOptionalof the desired type, for further mapping and filtering.optional()Returns this value asOptional, for further mapping and filtering.
-
Method Details
-
isPresent
Checks if this value isnull.- Returns:
trueif this value is present,falseifnull.
-
optional
Returns this value asOptional, for further mapping and filtering.- Returns:
Optionalof this value, orOptional.empty()if this value isnull.- See Also:
-
map
Returns this value as anOptionalof the desired type, for further mapping and filtering.- Parameters:
mapper- AFunctionthat converts aJSON.Valueto the desired type- Returns:
Optionalof this value, orOptional.empty()if this value isnull.- See Also:
-
asString
Returns the value asString. -
asObject
Returns the value as JSON object. -
asEncodedObject
Returns the value as JSON object that was Base64 URL encoded.- Since:
- 2.8
-
asProblem
Returns the value asProblem.- Parameters:
baseUrl- BaseURLto resolve relative links against
-
asIdentifier
Returns the value asIdentifier.- Since:
- 2.3
-
asArray
Returns the value asJSON.Array.Unlike the other getters, this method returns an empty array if the value is not set. Use
isPresent()to find out if the value was actually set. -
asInt
Returns the value as int. -
asBoolean
Returns the value as boolean. -
asURI
Returns the value asURI. -
asURL
Returns the value asURL. -
asInstant
Returns the value asInstant. -
asDuration
Returns the value asDuration.- Since:
- 2.3
-
asBinary
Returns the value as base64 decoded byte array. -
asStatus
Returns the parsedStatus. -
equals
-
hashCode
-