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
27 protected AbstractBaseType(String pkName, String name) {
\r
28 this.packageName = pkName;
\r
33 public int hashCode() {
\r
34 final int prime = 31;
\r
36 result = prime * result + ((name == null) ? 0 : name.hashCode());
\r
37 result = prime * result
\r
38 + ((packageName == null) ? 0 : packageName.hashCode());
\r
43 public boolean equals(Object obj) {
\r
48 if (getClass() != obj.getClass())
\r
50 Type other = (Type) obj;
\r
52 if (other.getName() != null)
\r
54 } else if (!name.equals(other.getName()))
\r
56 if (packageName == null) {
\r
57 if (other.getPackageName() != null)
\r
59 } else if (!packageName.equals(other.getPackageName()))
\r
65 public String toString() {
\r
67 return "Type (" + packageName + "." + name + ")";
\r