1 package org.opendaylight.controller.cluster.datastore.node.utils;
3 import org.opendaylight.yangtools.yang.data.api.InstanceIdentifier;
5 import java.util.regex.Matcher;
6 import java.util.regex.Pattern;
8 public class NodeIdentifierWithValueGenerator{
9 private final String id;
10 private static final Pattern pattern = Pattern.compile("(.*)\\Q[\\E(.*)\\Q]\\E");
11 private final Matcher matcher;
12 private final boolean doesMatch;
14 public NodeIdentifierWithValueGenerator(String id){
16 matcher = pattern.matcher(this.id);
17 doesMatch = matcher.matches();
20 public boolean matches(){
24 public InstanceIdentifier.PathArgument getPathArgument(){
25 final String name = matcher.group(1);
26 final String value = matcher.group(2);
28 return new InstanceIdentifier.NodeWithValue(
29 QNameFactory.create(name), value);