package org.terracotta.context.extractor;
import org.terracotta.context.ContextElement;
import java.util.Collections;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
class implements ContextElement {
private final Class<?> ;
private final Map<? extends String, AttributeGetter<Object>> ;
public (Class<?> identifier, Map<? extends String, AttributeGetter<Object>> attributes) {
this.identifier = identifier;
this.attributes = new HashMap<>(attributes);
}
@Override
public Class<?> () {
return identifier;
}
@Override
public Map<String, Object> () {
Map<String, Object> realized = new HashMap<>();
for (Entry<? extends String, AttributeGetter<Object>> e : attributes.entrySet()) {
realized.put(e.getKey(), e.getValue().get());
}
return Collections.unmodifiableMap(realized);
}
@Override
public String () {
return identifier() + " " + attributes();
}
}