Class ConfigUtil


  • public final class ConfigUtil
    extends Object
    Utility methods for config value retrieval.
    • Method Detail

      • getConfigField

        public static String getConfigField​(String fieldName,
                                            JsonValue config,
                                            String defaultValue)
        Retrieve a String config value with a default if the value is absent.
        Parameters:
        fieldName - the name of the config value to return
        config - the config potentially containing the config value
        defaultValue - the default to return if the value is absent
        Returns:
        the config value or the default value
      • getConfigField

        public static int getConfigField​(String fieldName,
                                         JsonValue config,
                                         int defaultValue)
        Retrieve an integer config value with a default if the value is absent.
        Parameters:
        fieldName - the name of the config value to return
        config - the config potentially containing the config value
        defaultValue - the default to return if the value is absent
        Returns:
        the config value or the default value