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(
19 "Parameter 'factoryName' is null");
20 if (instanceName == null)
21 throw new IllegalArgumentException(
22 "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) {
39 if (o == null || getClass() != o.getClass())
42 ModuleIdentifier that = (ModuleIdentifier) o;
44 if (!factoryName.equals(that.factoryName))
46 if (!instanceName.equals(that.instanceName))
53 public int hashCode() {
54 int result = factoryName.hashCode();
55 result = 31 * result + instanceName.hashCode();
60 public String toString() {
61 return "ModuleIdentifier{" + "factoryName='" + factoryName + '\''
62 + ", instanceName='" + instanceName + '\'' + '}';