com.makitoo.internal.PropertiesUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of feature-flag Show documentation
Show all versions of feature-flag Show documentation
The Java client for Makitoo feature handling.
The newest version!
package com.makitoo.internal;
import java.util.Properties;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* Created by nicolas on 26/01/17.
*/
public final class PropertiesUtils {
private PropertiesUtils() {}
private static final Logger LOGGER = Logger.getLogger(PropertiesUtils.class.getName());
public static int getIntProp(Properties properties, String name, int def) {
try {
if (properties.containsKey(name)) {
return Integer.parseInt(name);
}
} catch (NumberFormatException ex) {
LOGGER.log(Level.WARNING, ex.getMessage(), ex);
}
return def;
}
}