blob: c740b60c0ff2e2d2120404c2101935ee042804a4 [file] [log] [blame] [raw]
package protocolsupport.utils;
import java.util.function.Function;
public class JavaSystemProperty {
public static <T> T getValue(String property, T defaultValue, Function<String, T> converter) {
return JavaSystemProperty.getRawValue("protocolsupport."+property, defaultValue, converter);
}
public static <T> T getRawValue(String property, T defaultValue, Function<String, T> converter) {
try {
String value = System.getProperty(property);
if (value != null) {
return converter.apply(value);
}
} catch (Throwable t) {
}
return defaultValue;
}
}