Constructor and Description |
---|
JsonUtils() |
Modifier and Type | Method and Description |
---|---|
static com.google.gson.JsonElement |
getAsArray(Set<String> value)
Translate a set of strings to a JSON array, empty array returned as null
|
static com.google.gson.JsonElement |
getAsArray(Set<String> value,
boolean preserveEmpty)
Translate a set of strings to a JSON array, optionally preserving the empty array.
|
static Boolean |
getAsBoolean(com.google.gson.JsonObject o,
String member)
Gets the value of the given member as a boolean, null if it doesn't exist
|
static Date |
getAsDate(com.google.gson.JsonObject o,
String member)
Gets the value of the given member (expressed as integer seconds since epoch) as a Date
|
static List<com.nimbusds.jose.EncryptionMethod> |
getAsEncryptionMethodList(com.google.gson.JsonObject o,
String member)
Gets the value of the given member as a list of JWS Algorithms, null if it doesn't exist
|
static com.nimbusds.jose.JWEAlgorithm |
getAsJweAlgorithm(com.google.gson.JsonObject o,
String member)
Gets the value of the given member as a JWE Algorithm, null if it doesn't exist
|
static List<com.nimbusds.jose.JWEAlgorithm> |
getAsJweAlgorithmList(com.google.gson.JsonObject o,
String member)
Gets the value of the given member as a list of JWS Algorithms, null if it doesn't exist
|
static com.nimbusds.jose.EncryptionMethod |
getAsJweEncryptionMethod(com.google.gson.JsonObject o,
String member)
Gets the value of the given member as a JWE Encryption Method, null if it doesn't exist
|
static com.nimbusds.jose.JWSAlgorithm |
getAsJwsAlgorithm(com.google.gson.JsonObject o,
String member)
Gets the value of the given member as a JWS Algorithm, null if it doesn't exist
|
static List<com.nimbusds.jose.JWSAlgorithm> |
getAsJwsAlgorithmList(com.google.gson.JsonObject o,
String member)
Gets the value of the given member as a list of JWS Algorithms, null if it doesn't exist
|
static Long |
getAsLong(com.google.gson.JsonObject o,
String member)
Gets the value of the given member as a Long, null if it doesn't exist
|
static PKCEAlgorithm |
getAsPkceAlgorithm(com.google.gson.JsonObject o,
String member)
Gets the value of the given member as a PKCE Algorithm, null if it doesn't exist
|
static String |
getAsString(com.google.gson.JsonObject o,
String member)
Gets the value of the given member as a string, null if it doesn't exist
|
static List<String> |
getAsStringList(com.google.gson.JsonObject o,
String member)
Gets the value of the given given member as a set of strings, null if it doesn't exist
|
static Set<String> |
getAsStringSet(com.google.gson.JsonObject o,
String member)
Gets the value of the given given member as a set of strings, null if it doesn't exist
|
static Map |
readMap(com.google.gson.stream.JsonReader reader) |
static Set |
readSet(com.google.gson.stream.JsonReader reader) |
static void |
writeNullSafeArray(com.google.gson.stream.JsonWriter writer,
Set<String> items) |
public JsonUtils()
public static com.google.gson.JsonElement getAsArray(Set<String> value)
value
- public static com.google.gson.JsonElement getAsArray(Set<String> value, boolean preserveEmpty)
value
- preserveEmpty
- public static Date getAsDate(com.google.gson.JsonObject o, String member)
public static com.nimbusds.jose.JWEAlgorithm getAsJweAlgorithm(com.google.gson.JsonObject o, String member)
public static com.nimbusds.jose.EncryptionMethod getAsJweEncryptionMethod(com.google.gson.JsonObject o, String member)
public static com.nimbusds.jose.JWSAlgorithm getAsJwsAlgorithm(com.google.gson.JsonObject o, String member)
public static PKCEAlgorithm getAsPkceAlgorithm(com.google.gson.JsonObject o, String member)
o
- member
- public static String getAsString(com.google.gson.JsonObject o, String member)
public static Boolean getAsBoolean(com.google.gson.JsonObject o, String member)
public static Long getAsLong(com.google.gson.JsonObject o, String member)
public static Set<String> getAsStringSet(com.google.gson.JsonObject o, String member) throws com.google.gson.JsonSyntaxException
com.google.gson.JsonSyntaxException
public static List<String> getAsStringList(com.google.gson.JsonObject o, String member) throws com.google.gson.JsonSyntaxException
com.google.gson.JsonSyntaxException
public static List<com.nimbusds.jose.JWSAlgorithm> getAsJwsAlgorithmList(com.google.gson.JsonObject o, String member)
public static List<com.nimbusds.jose.JWEAlgorithm> getAsJweAlgorithmList(com.google.gson.JsonObject o, String member)
public static List<com.nimbusds.jose.EncryptionMethod> getAsEncryptionMethodList(com.google.gson.JsonObject o, String member)
public static Map readMap(com.google.gson.stream.JsonReader reader) throws IOException
IOException
public static Set readSet(com.google.gson.stream.JsonReader reader) throws IOException
IOException
public static void writeNullSafeArray(com.google.gson.stream.JsonWriter writer, Set<String> items) throws IOException
IOException
Copyright © 2018. All rights reserved.