Class ConfigUtil

java.lang.Object
swiss.trustbroker.common.util.ConfigUtil

public class ConfigUtil extends Object
application.yml config helper methods.
Intended for API implementations to simplify handling of generic Map<String, Object> attributes.
  • 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

      public static <T> Map<String,T> getConfigMap(Map<String,?> config, String name, Map<String,T> defaultValue)
    • getConfigString

      public static String getConfigString(Map<String,?> config, String name, String defaultValue)
    • getConfigInteger

      public static Integer getConfigInteger(Map<String,?> config, String name, Integer defaultValue)
    • getConfigBoolean

      public static Boolean getConfigBoolean(Map<String,?> config, String name, Boolean defaultValue)
    • getConfigList

      public static <T> List<T> getConfigList(Map<String,?> config, String name, List<T> defaultValue)
    • getGlobalAnnouncementAppName

      public static String getGlobalAnnouncementAppName(String applicationName)
    • removeIdSpecChar

      public static String removeIdSpecChar(String id)