X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?p=controller.git;a=blobdiff_plain;f=opendaylight%2Fconfig%2Fconfig-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fconfig%2Fapi%2FIdentityAttributeRef.java;h=735a6e1d272356cf748d39529c3de1e9c062059f;hp=5ad6e0da8d2bf8a29d8d403783e378c5ab950346;hb=f43b01b81319959b1907e3e04537f5169e7f33d8;hpb=f347d306c3580f0e10e8ad0c551432aa931d856a diff --git a/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/IdentityAttributeRef.java b/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/IdentityAttributeRef.java index 5ad6e0da8d..735a6e1d27 100644 --- a/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/IdentityAttributeRef.java +++ b/opendaylight/config/config-api/src/main/java/org/opendaylight/controller/config/api/IdentityAttributeRef.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved. + * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others. All rights reserved. * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License v1.0 which accompanies this distribution, @@ -7,56 +7,54 @@ */ package org.opendaylight.controller.config.api; -import org.opendaylight.yangtools.yang.binding.BaseIdentity; - import java.beans.ConstructorProperties; +import org.opendaylight.yangtools.yang.binding.BaseIdentity; public final class IdentityAttributeRef { public static final String QNAME_ATTR_NAME = "qNameOfIdentity"; - private final String qNameOfIdentity; + private final String qualifiedNameOfIdentity; @ConstructorProperties(QNAME_ATTR_NAME) - public IdentityAttributeRef(String qNameOfIdentity) { - if (qNameOfIdentity == null) { + public IdentityAttributeRef(final String qualifiedNameOfIdentity) { + if (qualifiedNameOfIdentity == null) { throw new NullPointerException("Parameter " + QNAME_ATTR_NAME + " is null"); } - this.qNameOfIdentity = qNameOfIdentity; + this.qualifiedNameOfIdentity = qualifiedNameOfIdentity; } public String getqNameOfIdentity() { - return qNameOfIdentity; + return qualifiedNameOfIdentity; } - public Class resolveIdentity(DependencyResolver resolver, Class baseIdentity) { + public Class resolveIdentity(final DependencyResolver resolver, + final Class baseIdentity) { return resolver.resolveIdentity(this, baseIdentity); } - public void validateIdentity(DependencyResolver resolver, Class baseIdentity, JmxAttribute jmxAttribute) { + public void validateIdentity(final DependencyResolver resolver, + final Class baseIdentity, final JmxAttribute jmxAttribute) { resolver.validateIdentity(this, baseIdentity, jmxAttribute); } @Override public String toString() { - final StringBuffer sb = new StringBuffer("IdentityAttributeRef{"); - sb.append("qNameOfIdentity='").append(qNameOfIdentity).append('\''); - sb.append('}'); - return sb.toString(); + return "IdentityAttributeRef{" + "qualifiedNameOfIdentity='" + qualifiedNameOfIdentity + "'}"; } @Override - public boolean equals(Object o) { - if (this == o) { + public boolean equals(final Object object) { + if (this == object) { return true; } - if (!(o instanceof IdentityAttributeRef)) { + if (!(object instanceof IdentityAttributeRef)) { return false; } - IdentityAttributeRef that = (IdentityAttributeRef) o; + IdentityAttributeRef that = (IdentityAttributeRef) object; - if (!qNameOfIdentity.equals(that.qNameOfIdentity)) { + if (!qualifiedNameOfIdentity.equals(that.qualifiedNameOfIdentity)) { return false; } @@ -65,7 +63,6 @@ public final class IdentityAttributeRef { @Override public int hashCode() { - return qNameOfIdentity.hashCode(); + return qualifiedNameOfIdentity.hashCode(); } - }