All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.makitoo.internal.PropertiesUtils Maven / Gradle / Ivy

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;
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy