org.mentalog.util.SystemUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of menta-log Show documentation
Show all versions of menta-log Show documentation
A log library that embraces the kiss principle.
package org.mentalog.util;
public class SystemUtils {
public static boolean getBoolean(String name, boolean def) {
String s = System.getenv(name);
if (s == null) s = System.getProperty(name);
if (s == null) return def;
return s.equals("true");
}
public static boolean getBoolean(String name) {
return getBoolean(name, false);
}
public static String getString(String name, String def) {
String s = System.getenv(name);
if (s == null) s = System.getProperty(name);
if (s == null) return def;
return s;
}
public static String getString(String name) {
return getString(name, null);
}
}