Implement hashCode and equals for Module

This commit is contained in:
Alexey Tsvetkov
2015-08-10 16:22:31 +03:00
parent 5f05f0d678
commit 18dc752c21
@@ -30,4 +30,15 @@ public interface Module {
public fun getAnnotationsRoots(): List<String>
public fun getJavaSourceRoots(): List<String>
override fun equals(other: Any?): Boolean =
when {
this === other -> true
other !is Module -> false
else -> getModuleName() == other.getModuleName() &&
getModuleType() == other.getModuleType()
}
override fun hashCode(): Int =
31 * getModuleName().hashCode() + getModuleType().hashCode()
}