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.concepts.Identifier;
12 public class ModuleIdentifier implements Identifier {
13 private static final long serialVersionUID = 1L;
14 private final String factoryName;
15 private final String instanceName;
17 public ModuleIdentifier(final String factoryName, final String instanceName) {
18 if (factoryName == null) {
19 throw new IllegalArgumentException("Parameter 'factoryName' is null");
21 if (instanceName == null) {
22 throw new IllegalArgumentException("Parameter 'instanceName' is null");
24 this.factoryName = factoryName;
25 this.instanceName = instanceName;
28 public String getFactoryName() {
32 public String getInstanceName() {
37 public boolean equals(final Object object) {
41 if (object == null || getClass() != object.getClass()) {
45 ModuleIdentifier that = (ModuleIdentifier) object;
47 if (!factoryName.equals(that.factoryName)) {
50 if (!instanceName.equals(that.instanceName)) {
58 public int hashCode() {
59 int result = factoryName.hashCode();
60 result = 31 * result + instanceName.hashCode();
65 public String toString() {
66 return "ModuleIdentifier{" + "factoryName='" + factoryName + '\''
67 + ", instanceName='" + instanceName + '\'' + '}';