@@ -0,0 +1,2139 @@
+package org.ocamljava.dependency.data;%0A%0Aimport java.io.File;%0A%0Aimport com.google.common.base.Objects;%0Aimport com.google.common.base.Optional;%0Aimport com.google.common.base.Preconditions;%0A%0Aclass ModuleDescriptor %7B%0A%0A%09public enum ModuleType %7B%0A%09%09%0A%09%09// TODO factor out constants from OcamlJavaConstants class into the ocamljava  mavencommon module%0A%09%09IMPL(%22ml%22), INTERFACE(%22mli%22);%0A%09%09%0A%09%09private final String extension;%0A%0A%09%09private ModuleType(final String extension) %7B%0A%09%09%09this.extension = Preconditions.checkNotNull(extension);%0A%09%09%7D%0A%09%09%0A%09%09public String getExtension() %7B%0A%09%09%09return extension;%0A%09%09%7D%0A%09%7D%0A%0A%09public ModuleDescriptor(final String moduleName,%0A%09%09%09final ModuleType moduleType, final File moduleFile) %7B%0A%09%09this(moduleName, moduleType, Optional.fromNullable(moduleFile));%0A%09%7D%0A%0A%09public ModuleDescriptor(final String moduleName,%0A%09%09%09final ModuleType moduleType, final Optional%3CFile%3E moduleFile) %7B%0A%09%09this.moduleName = Preconditions.checkNotNull(moduleName);%0A%09%09this.moduleType = Preconditions.checkNotNull(moduleType);%0A%09%09this.moduleFile = Preconditions.checkNotNull(moduleFile);%0A%09%7D%0A%0A%09public String getModuleName() %7B%0A%09%09return moduleName;%0A%09%7D%0A%0A%09public Optional%3CFile%3E getModuleFile() %7B%0A%09%09return moduleFile;%0A%09%7D%0A%0A%09public ModuleType getModuleType() %7B%0A%09%09return moduleType;%0A%09%7D%0A%0A%09final String moduleName;%0A%09final ModuleType moduleType;%0A%09final Optional%3CFile%3E moduleFile;%0A%09%0A%09@Override%0A%09public int hashCode() %7B%0A%09%09return Objects.hashCode(moduleName, moduleType, moduleFile);%0A%09%7D%0A%0A%09@Override%0A%09public boolean equals(final Object obj) %7B%0A%09%09if (this == obj)%0A%09%09%09return true; %0A%09%09if (obj == null)%0A%09%09%09return false;%0A%09%09if (getClass() != obj.getClass())%0A%09%09%09return false;%0A%09%09ModuleDescriptor other = (ModuleDescriptor) obj;%0A%09%09if (moduleFile == null) %7B%0A%09%09%09if (other.moduleFile != null)%0A%09%09%09%09return false;%0A%09%09%7D else if (!moduleFile.equals(other.moduleFile))%0A%09%09%09return false;%0A%09%09if (moduleName == null) %7B%0A%09%09%09if (other.moduleName != null)%0A%09%09%09%09return false;%0A%09%09%7D else if (!moduleName.equals(other.moduleName))%0A%09%09%09return false;%0A%09%09if (moduleType != other.moduleType)%0A%09%09%09return false;%0A%09%09return true;%0A%09%7D%0A%0A%09@Override%0A%09public String toString() %7B%0A%09%09return Objects.toStringHelper(this).toString();%0A%09%7D%0A%7D%0A

introduce module descriptor class