Package org.xipki.ca.gateway.acme.util
Class AcmeJson.Value
- java.lang.Object
-
- org.xipki.ca.gateway.acme.util.AcmeJson.Value
-
- Enclosing class:
- AcmeJson
public static final class AcmeJson.Value extends java.lang.ObjectA single JSON value. This instance also coversnullvalues.All return values are never
nullunless specified otherwise. For optional parameters, useoptional().
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AcmeJsonasObject()Returns the value as JSON object.java.lang.StringasString()Returns the value asString.booleanequals(java.lang.Object obj)inthashCode()booleanisPresent()Checks if this value isnull.java.util.Optional<AcmeJson.Value>optional()Returns this value asOptional, for further mapping and filtering.
-
-
-
Method Detail
-
isPresent
public boolean isPresent()
Checks if this value isnull.- Returns:
trueif this value is present,falseifnull.
-
optional
public java.util.Optional<AcmeJson.Value> optional()
Returns this value asOptional, for further mapping and filtering.- Returns:
Optionalof this value, orOptional.empty()if this value isnull.
-
asString
public java.lang.String asString() throws AcmeProtocolExceptionReturns the value asString.- Returns:
- the value as
String. - Throws:
AcmeProtocolException- if the value isnull.
-
asObject
public AcmeJson asObject() throws AcmeProtocolException
Returns the value as JSON object.- Returns:
- the value as JSON object.
- Throws:
AcmeProtocolException- if the value is not an instance of Map<String, Object>.
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-