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.mdsal.binding.model.util;
10 import org.opendaylight.mdsal.binding.model.api.JavaTypeName;
11 import org.opendaylight.mdsal.binding.model.api.Type;
14 * It is used only as ancestor for other <code>Type</code>s.
16 public class AbstractBaseType implements Type {
18 * Name of this <code>Type</code>.
20 private final JavaTypeName identifier;
23 public final JavaTypeName getIdentifier() {
24 return this.identifier;
28 * Constructs the instance of this class with a JavaTypeName.
30 * @param identifier for this <code>Type</code>
32 protected AbstractBaseType(final JavaTypeName identifier) {
33 if (identifier == null) {
34 throw new IllegalArgumentException("Identifier for Generated Type cannot be null!");
36 this.identifier = identifier;
40 public int hashCode() {
41 return identifier.hashCode();
45 public boolean equals(final Object obj) {
52 if (!(obj instanceof Type)) {
55 final Type other = (Type) obj;
56 return identifier.equals(other.getIdentifier());
60 public String toString() {
61 return "Type (" + getFullyQualifiedName() + ")";