Package swiss.trustbroker.common.util
Class ConfigUtil
java.lang.Object
swiss.trustbroker.common.util.ConfigUtil
application.yml config helper methods.
Intended for API implementations to simplify handling of generic
Intended for API implementations to simplify handling of generic
Map<String, Object> attributes.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> TExtract value from project for a specific type with an optional default and type coercion for some common application.yml conversions: String number to Integer String boolean to Boolean Number to String Map with index as key to Liststatic BooleangetConfigBoolean(Map<String, ?> config, String name, Boolean defaultValue) static IntegergetConfigInteger(Map<String, ?> config, String name, Integer defaultValue) static <T> List<T> getConfigList(Map<String, ?> config, String name, List<T> defaultValue) static StringgetConfigString(Map<String, ?> config, String name, String defaultValue) static StringgetGlobalAnnouncementAppName(String applicationName) static String
-
Method Details
-
getConfig
public static <T> T getConfig(Map<String, ?> config, String name, Class<T> resultClass, T defaultValue) Extract value from project for a specific type with an optional default and type coercion for some common application.yml conversions:- String number to Integer
- String boolean to Boolean
- Number to String
- Map with index as key to List
-
getConfigMap
-
getConfigString
-
getConfigInteger
-
getConfigBoolean
-
getConfigList
-
getGlobalAnnouncementAppName
-
removeIdSpecChar
-