2 * Copyright (c) 2013, 2017 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 java.beans.ConstructorProperties;
11 import org.opendaylight.yangtools.yang.binding.BaseIdentity;
13 public final class IdentityAttributeRef {
15 public static final String QNAME_ATTR_NAME = "qNameOfIdentity";
17 private final String qualifiedNameOfIdentity;
19 @ConstructorProperties(QNAME_ATTR_NAME)
20 public IdentityAttributeRef(final String qualifiedNameOfIdentity) {
21 if (qualifiedNameOfIdentity == null) {
22 throw new NullPointerException("Parameter " + QNAME_ATTR_NAME + " is null");
24 this.qualifiedNameOfIdentity = qualifiedNameOfIdentity;
27 public String getqNameOfIdentity() {
28 return qualifiedNameOfIdentity;
31 public <T extends BaseIdentity> Class<? extends T> resolveIdentity(final DependencyResolver resolver,
32 final Class<T> baseIdentity) {
33 return resolver.resolveIdentity(this, baseIdentity);
36 public <T extends BaseIdentity> void validateIdentity(final DependencyResolver resolver,
37 final Class<T> baseIdentity, final JmxAttribute jmxAttribute) {
38 resolver.validateIdentity(this, baseIdentity, jmxAttribute);
42 public String toString() {
43 return "IdentityAttributeRef{" + "qualifiedNameOfIdentity='" + qualifiedNameOfIdentity + "'}";
47 public boolean equals(final Object object) {
51 if (!(object instanceof IdentityAttributeRef)) {
55 IdentityAttributeRef that = (IdentityAttributeRef) object;
57 if (!qualifiedNameOfIdentity.equals(that.qualifiedNameOfIdentity)) {
65 public int hashCode() {
66 return qualifiedNameOfIdentity.hashCode();