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.model.util;
10 import java.util.Date;
11 import java.util.Objects;
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 + Objects.hashCode(moduleName);
45 result = prime * result + Objects.hashCode(revision);
46 result = prime * result + Objects.hashCode(prefix);
51 public boolean equals(final Object obj) {
58 if (getClass() != obj.getClass()) {
61 ModuleImport other = (ModuleImport) obj;
62 if (!Objects.equals(getModuleName(), other.getModuleName())) {
65 if (!Objects.equals(getRevision(), other.getRevision())) {
68 if (!Objects.equals(getPrefix(), other.getPrefix())) {
75 public String toString() {
76 return "ModuleImport[moduleName=" + moduleName + ", revision=" + revision + ", prefix=" + prefix + "]";