Package io.jans.as.model.util
Class Util
java.lang.Object
io.jans.as.model.util.Util
- Version:
- April 25, 2022
- Author:
- Yuriy Zabrovarnyy, Javier Rojas Blum
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddToJSONObjectIfNotNull(org.json.JSONObject jsonObject, String key, io.jans.orm.annotation.AttributeEnum value) static voidaddToJSONObjectIfNotNull(org.json.JSONObject jsonObject, String key, io.jans.orm.model.base.LocalizedString localizedString) static voidaddToJSONObjectIfNotNull(org.json.JSONObject jsonObject, String key, Object value) static voidaddToJSONObjectIfNotNull(org.json.JSONObject jsonObject, String key, String[] value) static voidaddToJSONObjectIfNotNullOrEmpty(org.json.JSONObject jsonObject, String key, String[] value) static voidaddToListIfHas(List<String> list, org.json.JSONObject jsonObj, String key) static booleanallNotBlank(String... strings) static <T extends io.jans.orm.annotation.AttributeEnum>
List<T>asEnumList(org.json.JSONArray array, Class<T> clazz) static intstatic Stringstatic StringasJsonSilently(Object object) asList(org.json.JSONArray array) static StringasPrettyJson(Object object) static StringasString(List<? extends HasParamName> list) static StringbyteArrayToHexString(byte[] b) static DatecreateExpirationDate(Integer lifetimeInSeconds) static com.fasterxml.jackson.databind.ObjectMapperstatic Stringstatic <T> Tstatic byte[]static booleanstatic booleanisNullOrEmpty(String string) static booleanjsonArrayStringAsList(String jsonString) jsonObjectArrayStringAsMap(String jsonString) static StringlistAsString(List<String> list) static org.json.JSONArraylistToJsonArray(Collection<String> list) static StringmapAsString(Map<String, String> map) static IntegerparseIntegerSilently(String intString) static intparseIntSilently(String intString) static intparseIntSilently(String intString, int defaultValue) static voidstatic voidputNotBlank(Map map, String key, Object value) splittedStringAsList(String string, String delimiter) static Map<String,Serializable> toSerializableMap(Map<String, Object> map) static StringtoSHA1HexString(String input)
-
Field Details
-
UTF8_STRING_ENCODING
- See Also:
-
PAR_ID_REFIX
- See Also:
-
PAR_ID_SHORT_REFIX
- See Also:
-
-
Method Details
-
putNotBlank
-
escapeLog
-
createJsonMapper
public static com.fasterxml.jackson.databind.ObjectMapper createJsonMapper() -
asJsonSilently
-
asPrettyJson
- Throws:
IOException
-
asJson
- Throws:
IOException
-
getBytes
-
asList
- Throws:
org.json.JSONException
-
asEnumList
public static <T extends io.jans.orm.annotation.AttributeEnum> List<T> asEnumList(org.json.JSONArray array, Class<T> clazz) throws org.json.JSONException, NoSuchMethodException, InvocationTargetException, IllegalAccessException - Throws:
org.json.JSONExceptionNoSuchMethodExceptionInvocationTargetExceptionIllegalAccessException
-
addToListIfHas
public static void addToListIfHas(List<String> list, org.json.JSONObject jsonObj, String key) throws org.json.JSONException - Throws:
org.json.JSONException
-
addToJSONObjectIfNotNull
public static void addToJSONObjectIfNotNull(org.json.JSONObject jsonObject, String key, Object value) throws org.json.JSONException - Throws:
org.json.JSONException
-
addToJSONObjectIfNotNull
public static void addToJSONObjectIfNotNull(org.json.JSONObject jsonObject, String key, io.jans.orm.annotation.AttributeEnum value) throws org.json.JSONException - Throws:
org.json.JSONException
-
addToJSONObjectIfNotNull
public static void addToJSONObjectIfNotNull(org.json.JSONObject jsonObject, String key, String[] value) throws org.json.JSONException - Throws:
org.json.JSONException
-
addToJSONObjectIfNotNullOrEmpty
public static void addToJSONObjectIfNotNullOrEmpty(org.json.JSONObject jsonObject, String key, String[] value) throws org.json.JSONException - Throws:
org.json.JSONException
-
addToJSONObjectIfNotNull
public static void addToJSONObjectIfNotNull(org.json.JSONObject jsonObject, String key, io.jans.orm.model.base.LocalizedString localizedString) throws org.json.JSONException - Throws:
org.json.JSONException
-
asString
-
listAsString
-
mapAsString
- Throws:
org.json.JSONException
-
allNotBlank
-
splittedStringAsList
-
jsonArrayStringAsList
- Throws:
org.json.JSONException
-
listToJsonArray
-
jsonObjectArrayStringAsMap
public static Map<String,String> jsonObjectArrayStringAsMap(String jsonString) throws org.json.JSONException - Parameters:
jsonString- [{"CustomHeader1":"custom_header_value_1"},.....,{"CustomHeaderN":"custom_header_value_N"}]- Returns:
- Throws:
org.json.JSONException
-
firstItem
-
isNullOrEmpty
-
parseIntSilently
-
parseIntSilently
-
isBuiltInPasswordAuthn
-
asInt
-
parseIntegerSilently
-
toSHA1HexString
-
byteArrayToHexString
-
createExpirationDate
-
isPar
-
toSerializableMap
-
toSerializableMapOfStrings
-
putArray
-