mirror of
https://github.com/datahub-project/datahub.git
synced 2025-07-05 16:22:17 +00:00
19 lines
513 B
Java
19 lines
513 B
Java
![]() |
package utils;
|
||
|
|
||
|
import com.typesafe.config.Config;
|
||
|
|
||
|
|
||
|
public class ConfigUtil {
|
||
|
public static boolean getBoolean(Config config, String key) {
|
||
|
return config.hasPath(key) && config.getBoolean(key);
|
||
|
}
|
||
|
|
||
|
public static int getInt(Config config, String key, int defaultValue) {
|
||
|
return config.hasPath(key) ? config.getInt(key) : defaultValue;
|
||
|
}
|
||
|
|
||
|
public static String getString(Config config, String key, String defaultValue) {
|
||
|
return config.hasPath(key) ? config.getString(key) : defaultValue;
|
||
|
}
|
||
|
}
|