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 public class ModuleIdentifier {
11 private static final long serialVersionUID = 1L;
12 private final String factoryName, instanceName;
14 public ModuleIdentifier(String factoryName, String instanceName) {
15 if (factoryName == null)
16 throw new IllegalArgumentException(
17 "Parameter 'factoryName' is null");
18 if (instanceName == null)
19 throw new IllegalArgumentException(
20 "Parameter 'instanceName' is null");
21 this.factoryName = factoryName;
22 this.instanceName = instanceName;
25 public String getFactoryName() {
29 public String getInstanceName() {
34 public boolean equals(Object o) {
37 if (o == null || getClass() != o.getClass())
40 ModuleIdentifier that = (ModuleIdentifier) o;
42 if (!factoryName.equals(that.factoryName))
44 if (!instanceName.equals(that.instanceName))
51 public int hashCode() {
52 int result = factoryName.hashCode();
53 result = 31 * result + instanceName.hashCode();
58 public String toString() {
59 return "ModuleIdentifier{" + "factoryName='" + factoryName + '\''
60 + ", instanceName='" + instanceName + '\'' + '}';