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, instanceName;
16 public ModuleIdentifier(String factoryName, String instanceName) {
17 if (factoryName == null) {
18 throw new IllegalArgumentException("Parameter 'factoryName' is null");
20 if (instanceName == null) {
21 throw new IllegalArgumentException("Parameter 'instanceName' is null");
23 this.factoryName = factoryName;
24 this.instanceName = instanceName;
27 public String getFactoryName() {
31 public String getInstanceName() {
36 public boolean equals(Object o) {
40 if (o == null || getClass() != o.getClass()) {
44 ModuleIdentifier that = (ModuleIdentifier) o;
46 if (!factoryName.equals(that.factoryName)) {
49 if (!instanceName.equals(that.instanceName)) {
57 public int hashCode() {
58 int result = factoryName.hashCode();
59 result = 31 * result + instanceName.hashCode();
64 public String toString() {
65 return "ModuleIdentifier{" + "factoryName='" + factoryName + '\''
66 + ", instanceName='" + instanceName + '\'' + '}';