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.sal.binding.generator.impl;
10 import org.opendaylight.controller.sal.binding.model.api.Type;
13 final class ReferencedTypeImpl implements Type {
15 private final String packageName;
16 private final String name;
18 public ReferencedTypeImpl(String packageName, String name) {
20 this.packageName = packageName;
25 * @see org.opendaylight.controller.sal.binding.model.api.Type#getPackageName()
28 public String getPackageName() {
33 * @see org.opendaylight.controller.sal.binding.model.api.Type#getName()
36 public String getName() {
41 public int hashCode() {
44 result = prime * result + ((name == null) ? 0 : name.hashCode());
45 result = prime * result
46 + ((packageName == null) ? 0 : packageName.hashCode());
51 public boolean equals(Object obj) {
58 if (getClass() != obj.getClass()) {
61 ReferencedTypeImpl other = (ReferencedTypeImpl) obj;
63 if (other.name != null) {
66 } else if (!name.equals(other.name)) {
69 if (packageName == null) {
70 if (other.packageName != null) {
73 } else if (!packageName.equals(other.packageName)) {
80 public String toString() {
81 StringBuilder builder = new StringBuilder();
82 builder.append("ReferencedTypeImpl [packageName=");
83 builder.append(packageName);
84 builder.append(", name=");
87 return builder.toString();