2 * Copyright (c) 2014, 2015 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.cluster.datastore.node.utils;
11 import com.google.common.base.Preconditions;
12 import org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode;
14 public class NormalizedNodeGetter implements
15 NormalizedNodeVisitor {
16 private final String path;
17 NormalizedNode<?, ?> output;
19 public NormalizedNodeGetter(String path){
20 Preconditions.checkNotNull(path);
25 public void visitNode(int level, String parentPath, NormalizedNode<?, ?> normalizedNode) {
26 String nodePath = parentPath + "/"+ PathUtils.toString(normalizedNode.getIdentifier());
28 if(nodePath.toString().equals(path)){
29 output = normalizedNode;
33 public NormalizedNode<?, ?> getOutput(){