no.difi.certvalidator.util.SimpleReport Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of commons-certvalidator Show documentation
Show all versions of commons-certvalidator Show documentation
Rule engine for creation of certificate validator.
package no.difi.certvalidator.util;
import no.difi.certvalidator.api.Property;
import no.difi.certvalidator.api.Report;
import java.util.HashMap;
import java.util.Map;
import java.util.Set;
/**
* @author erlend
*/
public class SimpleReport implements Report {
private final Map values;
public static Report newInstance() {
return new SimpleReport();
}
private SimpleReport() {
this(new HashMap());
}
private SimpleReport(Map values) {
this.values = values;
}
@Override
public boolean contains(Property key) {
return values.containsKey(key);
}
@Override
public void set(Property key, T value) {
values.put(key, value);
}
@Override
@SuppressWarnings("unchecked")
public T get(Property key) {
return (T) values.get(key);
}
@Override
public Set keys() {
return values.keySet();
}
@Override
public Report copy() {
return new SimpleReport(new HashMap<>(values));
}
}