Extended RcsReousrceAttributes to support update of multiple attributes at once
[platform/upstream/iotivity.git] / service / resource-container / android / resource-container / src / main / java / org / iotivity / service / resourcecontainer / RcsResourceAttributes.java
index f3611b1..219a9a6 100644 (file)
@@ -63,6 +63,12 @@ public final class RcsResourceAttributes extends RcsObject {
             mCache.put(key, lockedAttrs.get(key));
         }
     }
+    
+    public RcsResourceAttributes(RcsResourceAttributes attrs){
+        for (final String key : attrs.keySet()) {
+            mCache.put(key, attrs.get(key));
+        }
+    }
 
     /**
      * Returns a unmodifiable Set view of the keys contained in this attributes.
@@ -232,5 +238,14 @@ public final class RcsResourceAttributes extends RcsObject {
         esnureAllExtracted();
         return mCache.hashCode();
     }
+    
+    /**
+     * Updates all properties provided as parameter.
+     */
+    public void put(RcsResourceAttributes attrs){
+        for (final String key : attrs.keySet()) {
+            mCache.put(key, attrs.get(key));
+        }
+    }
 
 }