Am 10.10.14 um 18:34 schrieb Sandro Boehme:
> 
>> Metadata is an extension of Map/HashMap, so creating a new Map object
>> and doing a putAll() should do the trick
> Ok, to be short and more clear: If the resource to be wrapped has a
> JcrNodeResourceMetadata object instead of a plain ResourceMetadata
> object, how would you instantiate it to create a copy using the Map
> interface?
> And would you handle every other ResourceMetadata type that might be
> added in the future individually?
> My use case is, to wrap all resources no matter what ResourceMetadata
> type they have.
> 
As I said, treat the metadata as a map and don't care about the
implementation.
Create a new metadata object and simply copy all values from the wrapped
metadata.
It's a two liner: create a map, copy all values. Done

Carsten

> Best,
> 
> Sandro
> 


-- 
Carsten Ziegeler
Adobe Research Switzerland
cziege...@apache.org

Reply via email to