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

io.soffa.foundation.commons.Properties Maven / Gradle / Ivy

There is a newer version: 2.0.2
Show newest version
package io.soffa.foundation.commons;

import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;

public class Properties {

    private final Map internal;

    public Properties(Map internal) {
        this.internal = internal;
    }

    public Properties() {
        this(new ConcurrentHashMap<>());
    }

    public boolean has(String name) {
        return internal.containsKey(name);
    }

    public String get(String name, String defaultValue) {
        if (!has(name)) {
            return defaultValue;
        }
        return internal.get(name);
    }

    public int getInt(String name, int defaultValue) {
        if (!has(name)) {
            return defaultValue;
        }
        return Integer.parseInt(internal.get(name));
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy