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

org.lumongo.util.properties.FakePropertiesReader Maven / Gradle / Ivy

There is a newer version: 0.52
Show newest version
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