I don't like having two accessors for the same information either but we're
choosing between the lesser of two evils here. If you only had
`complexMetadata`, you'd be forcing users to always write code like
Object value = image.getComplexMetadata().get("key");
if (value instanceof List) {
// do something
}
else if (value instanceof Map) {
// do something
}
else {
// treat it like a String
}
Instead of dealing with the more common case
String value = image.getMetadata().get("key");
It's a testament to how common the `<String, String>` case is that this issue
has only come up relatively recent and openstack-nova has been in use for years.
Anything more than one line to deal with metadata is more evil than two
accessors for the same info.
P.S. Let's not lose site of the fact that it's the Nova API that's forcing this
horribleness on us and forcing us to choose between these two crappy options.
I'll be addressing this in OpenStack itself by proposing a guideline to the
[API Working Group](https://wiki.openstack.org/wiki/API_Working_Group) that
will (one day) stop this kind of thing from happening.
---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/626#issuecomment-67413988