2 * Copyright (c) 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.config.facade.xml.mapping;
11 import com.google.common.base.Preconditions;
12 import com.google.common.collect.Maps;
14 import org.opendaylight.yangtools.yang.model.api.IdentitySchemaNode;
16 public class IdentityMapping {
17 private final Map<String, IdentitySchemaNode> identityNameToSchemaNode;
19 public IdentityMapping() {
20 this.identityNameToSchemaNode = Maps.newHashMap();
23 public void addIdSchemaNode(IdentitySchemaNode node) {
24 String name = node.getQName().getLocalName();
25 Preconditions.checkState(!identityNameToSchemaNode.containsKey(name));
26 identityNameToSchemaNode.put(name, node);
29 public boolean containsIdName(String idName) {
30 return identityNameToSchemaNode.containsKey(idName);