mirror of
https://github.com/Frooodle/Stirling-PDF.git
synced 2024-12-31 00:08:08 +01:00
50 lines
1.3 KiB
Java
50 lines
1.3 KiB
Java
package stirling.software.SPDF.utils;
|
|
|
|
import java.util.List;
|
|
|
|
public class PropertyConfigs {
|
|
|
|
|
|
public static boolean getBooleanValue(List<String> keys, boolean defaultValue) {
|
|
for (String key : keys) {
|
|
String value = System.getProperty(key);
|
|
if (value == null)
|
|
value = System.getenv(key);
|
|
|
|
if (value != null)
|
|
return Boolean.valueOf(value);
|
|
}
|
|
return defaultValue;
|
|
}
|
|
|
|
public static String getStringValue(List<String> keys, String defaultValue) {
|
|
for (String key : keys) {
|
|
String value = System.getProperty(key);
|
|
if (value == null)
|
|
value = System.getenv(key);
|
|
|
|
if (value != null)
|
|
return value;
|
|
}
|
|
return defaultValue;
|
|
}
|
|
|
|
|
|
|
|
|
|
public static boolean getBooleanValue(String key, boolean defaultValue) {
|
|
String value = System.getProperty(key);
|
|
if (value == null)
|
|
value = System.getenv(key);
|
|
return (value != null) ? Boolean.valueOf(value) : defaultValue;
|
|
}
|
|
|
|
public static String getStringValue(String key, String defaultValue) {
|
|
String value = System.getProperty(key);
|
|
if (value == null)
|
|
value = System.getenv(key);
|
|
return (value != null) ? value : defaultValue;
|
|
}
|
|
|
|
}
|