2 * Copyright (c) 2013 Cisco Systems, Inc. and others. All rights reserved.
\r
4 * This program and the accompanying materials are made available under the
\r
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
\r
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
\r
8 package org.opendaylight.controller.binding.generator.util;
\r
10 import org.opendaylight.controller.sal.binding.model.api.Type;
\r
12 public class AbstractBaseType implements Type {
\r
14 private final String packageName;
\r
15 private final String name;
\r
18 public String getPackageName() {
\r
23 public String getName() {
\r
28 protected AbstractBaseType(String pkName, String name) {
\r
29 this.packageName = pkName;
\r
34 public int hashCode() {
\r
35 final int prime = 31;
\r
37 result = prime * result + ((name == null) ? 0 : name.hashCode());
\r
38 result = prime * result
\r
39 + ((packageName == null) ? 0 : packageName.hashCode());
\r
44 public boolean equals(Object obj) {
\r
49 if (getClass() != obj.getClass())
\r
51 Type other = (Type) obj;
\r
53 if (other.getName() != null)
\r
55 } else if (!name.equals(other.getPackageName()))
\r
57 if (packageName == null) {
\r
58 if (other.getPackageName() != null)
\r
60 } else if (!packageName.equals(other.getPackageName()))
\r
66 public String toString() {
\r
68 return "Type (" + packageName + "." + name + ")";
\r