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.yangtools.yang.parser.util;
10 import java.util.Date;
12 import org.opendaylight.yangtools.yang.model.api.ModuleImport;
14 public final class ModuleImportImpl implements ModuleImport {
15 private final String moduleName;
16 private final Date revision;
17 private final String prefix;
19 public ModuleImportImpl(final String moduleName, final Date revision, final String prefix) {
20 this.moduleName = moduleName;
21 this.revision = revision;
26 public String getModuleName() {
31 public Date getRevision() {
36 public String getPrefix() {
41 public int hashCode() {
44 result = prime * result + ((moduleName == null) ? 0 : moduleName.hashCode());
45 result = prime * result + ((revision == null) ? 0 : revision.hashCode());
46 result = prime * result + ((prefix == null) ? 0 : prefix.hashCode());
51 public boolean equals(Object obj) {
58 if (getClass() != obj.getClass()) {
61 ModuleImport other = (ModuleImport) obj;
62 if (getModuleName() == null) {
63 if (other.getModuleName() != null) {
66 } else if (!getModuleName().equals(other.getModuleName())) {
69 if (getRevision() == null) {
70 if (other.getRevision() != null) {
73 } else if (!getRevision().equals(other.getRevision())) {
76 if (getPrefix() == null) {
77 if (other.getPrefix() != null) {
80 } else if (!getPrefix().equals(other.getPrefix())) {
87 public String toString() {
88 return "ModuleImport[moduleName=" + moduleName + ", revision=" + revision + ", prefix=" + prefix + "]";