mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-11-14 00:12:06 +01:00
Add equals() and hashCode() methods to Depth
This commit is contained in:
parent
45fa626a79
commit
423183bece
1 changed files with 12 additions and 0 deletions
|
@ -93,7 +93,19 @@ class Depth(val limit: Int?) : Comparable<Depth> {
|
|||
}
|
||||
}
|
||||
|
||||
override fun equals(other: Any?): Boolean {
|
||||
if (other !is Depth) {
|
||||
return false
|
||||
}
|
||||
|
||||
return limit == other.limit
|
||||
}
|
||||
|
||||
override fun toString() : String {
|
||||
return if (isUnconstrained()) { "unconstrained" } else { limit!!.toString() }
|
||||
}
|
||||
|
||||
override fun hashCode(): Int {
|
||||
return limit ?: 0
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue