2 * Copyright (c) 2013 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
8 package org.opendaylight.controller.config.api;
10 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
12 import java.beans.ConstructorProperties;
14 public final class IdentityAttributeRef {
16 public static final String QNAME_ATTR_NAME = "qNameOfIdentity";
18 private final String qNameOfIdentity;
20 @ConstructorProperties(QNAME_ATTR_NAME)
21 public IdentityAttributeRef(String qNameOfIdentity) {
22 if (qNameOfIdentity == null) {
23 throw new NullPointerException("Parameter " + QNAME_ATTR_NAME + " is null");
25 this.qNameOfIdentity = qNameOfIdentity;
28 public String getqNameOfIdentity() {
29 return qNameOfIdentity;
32 public <T extends BaseIdentity> Class<? extends T> resolveIdentity(DependencyResolver resolver, Class<T> baseIdentity) {
33 return resolver.resolveIdentity(this, baseIdentity);
36 public <T extends BaseIdentity> void validateIdentity(DependencyResolver resolver, Class<T> baseIdentity, JmxAttribute jmxAttribute) {
37 resolver.validateIdentity(this, baseIdentity, jmxAttribute);
41 public String toString() {
42 final StringBuffer sb = new StringBuffer("IdentityAttributeRef{");
43 sb.append("qNameOfIdentity='").append(qNameOfIdentity).append('\'');
49 public boolean equals(Object o) {
53 if (!(o instanceof IdentityAttributeRef)) {
57 IdentityAttributeRef that = (IdentityAttributeRef) o;
59 if (!qNameOfIdentity.equals(that.qNameOfIdentity)) {
67 public int hashCode() {
68 return qNameOfIdentity.hashCode();