Added test cases for each .proto file to ensure
[controller.git] / opendaylight / md-sal / sal-protocolbuffer-encoding / src / main / java / org / opendaylight / controller / cluster / datastore / node / utils / NodeIdentifierWithPredicatesGenerator.java
index 40b5c2e813c82007b5d3e5112a01055fa638ab33..6d3a26ad77fe73889ecfe4ae77a5b6259dcec94a 100644 (file)
@@ -1,3 +1,13 @@
+/*
+ *
+ *  Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
+ *
+ *  This program and the accompanying materials are made available under the
+ *  terms of the Eclipse Public License v1.0 which accompanies this distribution,
+ *  and is available at http://www.eclipse.org/legal/epl-v10.html
+ *
+ */
+
 package org.opendaylight.controller.cluster.datastore.node.utils;
 
 import org.opendaylight.yangtools.yang.common.QName;
@@ -19,15 +29,16 @@ public class NodeIdentifierWithPredicatesGenerator{
     private final boolean doesMatch;
     private final ListSchemaNode listSchemaNode;
 
-    public NodeIdentifierWithPredicatesGenerator(String id){
-        this(id, null);
-    }
-
-    public NodeIdentifierWithPredicatesGenerator(String id, ListSchemaNode schemaNode){
+    public NodeIdentifierWithPredicatesGenerator(String id, DataSchemaNode schemaNode){
         this.id = id;
         matcher = pattern.matcher(this.id);
         doesMatch = matcher.matches();
-        this.listSchemaNode = schemaNode;
+
+        if(schemaNode instanceof  ListSchemaNode){
+            this.listSchemaNode = (ListSchemaNode) schemaNode;
+        } else {
+            this.listSchemaNode = null;
+        }
     }