Going by the unwrap() way would require us to be provider-aware and hence
losing out on having a generic code. On the other hand, having key-value
pair would just require skimming through the map, irrespective of any
provider. If only it exists :)

The closest you can get to that is NodeMetadata.userMetdata [1], which every provider may populate differently.

As regards just getting "all the other" properties of an object in some kind of "other" collection: two reasons I can recall why jclouds does not do this is that

* you lose any kind of typed domain model and
* you end up writing code similar to "if (otherPropertiesBag.containsKey("someProperty")) { ... }", which is basically a form of provider-specific code.

Of course, it's true that "otherPropertiesBag.contains("pricingModel")" is less explicitly provider-specific than "targetApi == "aws-ec2", but in order to be able to correctly understand what "pricingModel" means you pretty much have to know which provider or provider class you're talking to.

ap

[1] http://javadocs.jclouds.cloudbees.net/org/jclouds/domain/ResourceMetadata.html#getUserMetadata()

Reply via email to