X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-protocolbuffer-encoding%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fcluster%2Fdatastore%2Fnode%2Futils%2FNodeIdentifierWithPredicatesGenerator.java;h=6d3a26ad77fe73889ecfe4ae77a5b6259dcec94a;hp=40b5c2e813c82007b5d3e5112a01055fa638ab33;hb=69eca29208f36b9a02992319cc36d1d221189ff0;hpb=d255fdd0b14660a22ff63771d954ac3fe5d0cb7e diff --git a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierWithPredicatesGenerator.java b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierWithPredicatesGenerator.java index 40b5c2e813..6d3a26ad77 100644 --- a/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierWithPredicatesGenerator.java +++ b/opendaylight/md-sal/sal-protocolbuffer-encoding/src/main/java/org/opendaylight/controller/cluster/datastore/node/utils/NodeIdentifierWithPredicatesGenerator.java @@ -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; + } }