mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[Workspace Model] ConnectionId is no more dataclass
GitOrigin-RevId: b713d1ed90043e9c4a6c497b5f98503a131d1db9
This commit is contained in:
committed by
intellij-monorepo-bot
parent
f34ef6aabf
commit
c0af13dcab
@@ -9,7 +9,7 @@ import com.intellij.workspace.api.pstorage.containers.*
|
||||
import pstorage.containers.LinkedBidirectionalMap
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
internal data class ConnectionId<T : TypedEntity, SUBT : TypedEntity> private constructor(
|
||||
internal class ConnectionId<T : TypedEntity, SUBT : TypedEntity> private constructor(
|
||||
val parentClass: KClass<T>,
|
||||
val childClass: KClass<SUBT>,
|
||||
val connectionType: ConnectionType,
|
||||
@@ -23,6 +23,30 @@ internal data class ConnectionId<T : TypedEntity, SUBT : TypedEntity> private co
|
||||
ABSTRACT_ONE_TO_ONE
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (this === other) return true
|
||||
if (javaClass != other?.javaClass) return false
|
||||
|
||||
other as ConnectionId<*, *>
|
||||
|
||||
if (parentClass.java != other.parentClass.java) return false
|
||||
if (childClass.java != other.childClass.java) return false
|
||||
if (connectionType != other.connectionType) return false
|
||||
if (isParentNullable != other.isParentNullable) return false
|
||||
if (isChildNullable != other.isChildNullable) return false
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
var result = parentClass.java.hashCode()
|
||||
result = 31 * result + childClass.java.hashCode()
|
||||
result = 31 * result + connectionType.hashCode()
|
||||
result = 31 * result + isParentNullable.hashCode()
|
||||
result = 31 * result + isChildNullable.hashCode()
|
||||
return result
|
||||
}
|
||||
|
||||
companion object {
|
||||
/** This function should be [@Synchronized] because interner is not thread-save */
|
||||
@Suppress("UNCHECKED_CAST")
|
||||
|
||||
Reference in New Issue
Block a user