Implement hashCode and equals for Module
This commit is contained in:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user