Fix checkstyle issues to enforce it
[controller.git] / opendaylight / config / config-manager / src / main / java / org / opendaylight / controller / config / manager / impl / jmx / ServiceReference.java
1 /*
2  * Copyright (c) 2013, 2017 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.config.manager.impl.jmx;
9
10 public class ServiceReference {
11     private final String serviceInterfaceName;
12     private final String refName;
13
14     public ServiceReference(final String serviceInterfaceName, final String refName) {
15         this.serviceInterfaceName = serviceInterfaceName;
16         this.refName = refName;
17     }
18
19     public String getServiceInterfaceQName() {
20         return serviceInterfaceName;
21     }
22
23     public String getRefName() {
24         return refName;
25     }
26
27     @Override
28     public boolean equals(final Object object) {
29         if (this == object) {
30             return true;
31         }
32         if (object == null || getClass() != object.getClass()) {
33             return false;
34         }
35
36         ServiceReference that = (ServiceReference) object;
37
38         if (!refName.equals(that.refName)) {
39             return false;
40         }
41         if (!serviceInterfaceName.equals(that.serviceInterfaceName)) {
42             return false;
43         }
44
45         return true;
46     }
47
48     @Override
49     public int hashCode() {
50         int result = serviceInterfaceName.hashCode();
51         result = 31 * result + refName.hashCode();
52         return result;
53     }
54
55     @Override
56     public String toString() {
57         return "ServiceReference{" + "serviceInterfaceName='" + serviceInterfaceName + '\'' + ", refName='" + refName
58                 + '\'' + '}';
59     }
60 }