Skip to content

Commit 172a247

Browse files
author
Salvi
committed
Added equals and hashCode
1 parent 7cd39c6 commit 172a247

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

src/main/kotlin/it/intre/code/database/reader/filter/FilterContainer.kt

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,4 +65,24 @@ class FilterContainer {
6565
return page != null && page > -1
6666
}
6767

68+
override fun equals(other: Any?): Boolean {
69+
if (this === other) return true
70+
if (other !is FilterContainer) return false
71+
72+
if (profile != other.profile) return false
73+
if (customFilters != other.customFilters) return false
74+
if (queryStringFilter != other.queryStringFilter) return false
75+
if (paramValues != other.paramValues) return false
76+
77+
return true
78+
}
79+
80+
override fun hashCode(): Int {
81+
var result = profile?.hashCode() ?: 0
82+
result = 31 * result + customFilters.hashCode()
83+
result = 31 * result + queryStringFilter.hashCode()
84+
result = 31 * result + paramValues.hashCode()
85+
return result
86+
}
87+
6888
}

0 commit comments

Comments
 (0)