Merge "Fixing mutability for ResourceId."
diff --git a/model/src/main/java/org/onosproject/yang/model/ResourceId.java b/model/src/main/java/org/onosproject/yang/model/ResourceId.java
index 206939d..2ccd09a 100644
--- a/model/src/main/java/org/onosproject/yang/model/ResourceId.java
+++ b/model/src/main/java/org/onosproject/yang/model/ResourceId.java
@@ -16,6 +16,8 @@
package org.onosproject.yang.model;
+import com.google.common.collect.ImmutableList;
+
import java.util.LinkedList;
import java.util.List;
@@ -30,12 +32,12 @@
* hierarchy to reach a resource in the instance tree.
*/
-public class ResourceId {
+public final class ResourceId {
/**
* List of node keys.
*/
- private List<NodeKey> nodeKeyList;
+ private final List<NodeKey> nodeKeyList;
/**
* Create object from builder.
@@ -43,7 +45,7 @@
* @param builder initialized builder
*/
public ResourceId(Builder builder) {
- nodeKeyList = builder.nodeKeyList;
+ nodeKeyList = ImmutableList.copyOf(builder.nodeKeyList);
}
/**