io.soffa.foundation.commons.Properties Maven / Gradle / Ivy
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