org.lumongo.util.properties.FakePropertiesReader Maven / Gradle / Ivy
package org.lumongo.util.properties;
import java.util.HashMap;
public class FakePropertiesReader extends PropertiesReader {
private HashMap propetiesMap;
private String name;
public FakePropertiesReader(String name, HashMap propetiesMap) {
super(name);
this.propetiesMap = propetiesMap;
}
@Override
public String getString(String key) throws PropertyException {
String value = propetiesMap.get(key);
if (value != null) {
return value;
}
throw new PropertyException(this.name, key, "Failed to find key.");
}
@Override
public boolean hasKey(String key) {
return propetiesMap.containsKey(key);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy