nl.hsac.fitnesse.fixture.fit.MapParameter Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hsac-fitnesse-fixtures Show documentation
Show all versions of hsac-fitnesse-fixtures Show documentation
Fixtures to assist in testing via FitNesse
package nl.hsac.fitnesse.fixture.fit;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* Parameter for Maps to be passed from one fixture to another.
*/
public class MapParameter extends HashMap {
private final static Map INSTANCES = new ConcurrentHashMap();
private final String key;
/**
* Creates new.
* @param aHeaderName display type name
* @param aNr instance number
*/
public MapParameter(String aHeaderName, String aNr) {
key = aHeaderName + "@" + aNr;
INSTANCES.put(toString(), this);
}
public static MapParameter parse(String value) {
return INSTANCES.get(value);
}
public String toString() {
// ensure unique toString that does not change
return key;
}
/**
* Clears set of known map parameters (that can be returned by parse()).
*/
public static void clearInstances() {
INSTANCES.clear();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy