Package org.xipki.ca.gateway.acme.util
Class AcmeJson
- java.lang.Object
-
- org.xipki.ca.gateway.acme.util.AcmeJson
-
public final class AcmeJson extends java.lang.ObjectA model containing a JSON result. The content is immutable.- Author:
- ACME4J team
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAcmeJson.ArrayRepresents a JSON array.static classAcmeJson.ValueA single JSON value.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(java.lang.String key)Checks if this object contains the given key.AcmeJson.Valueget(java.lang.String key)Returns theAcmeJson.Valueof the given key.java.util.Set<java.lang.String>keySet()Returns a set of all keys of this object.static AcmeJsonparse(byte[] bytes)Parses JSON from byte[].static AcmeJsonparse(java.lang.String json)Parses JSON from a String.java.lang.StringtoString()Returns the content as JSON string.
-
-
-
Method Detail
-
parse
public static AcmeJson parse(byte[] bytes) throws AcmeProtocolException
Parses JSON from byte[].- Parameters:
bytes- Bytes.- Returns:
AcmeJsonof the read content.- Throws:
AcmeProtocolException- if error while parsing the object.
-
parse
public static AcmeJson parse(java.lang.String json) throws AcmeProtocolException
Parses JSON from a String.- Parameters:
json- JSON string- Returns:
AcmeJsonof the read content.- Throws:
AcmeProtocolException- if error while parsing the object.
-
keySet
public java.util.Set<java.lang.String> keySet()
Returns a set of all keys of this object.- Returns:
Setof keys.
-
contains
public boolean contains(java.lang.String key)
Checks if this object contains the given key.- Parameters:
key- Name of the key to check- Returns:
trueif the key is present
-
get
public AcmeJson.Value get(java.lang.String key)
Returns theAcmeJson.Valueof the given key.- Parameters:
key- Key to read- Returns:
AcmeJson.Valueof the key
-
toString
public java.lang.String toString()
Returns the content as JSON string.- Overrides:
toStringin classjava.lang.Object
-
-