}
@SuppressWarnings("unchecked")
public <AdapterType> AdapterType adaptTo(Class<AdapterType> type) {
if (type == ValueMap.class) {
ValueMap map = new ValueMapDecorator(new HashMap<String, Object>());
if (resourceType != null) {
map.put("resourceType", resourceType);
}
if (resourceSuperType != null) {
map.put("resourceSuperType", resourceSuperType);
}
for (String key : this.properties.keySet()) {
map.put(key,this.properties.get(key));
}
return (AdapterType) map;
}
throw new UnsupportedOperationException("AdaptTo " + type.getSimpleName() + " not implemented");
}