io.smooth.constraint.ConstraintsResult.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of constraints Show documentation
Show all versions of constraints Show documentation
A suite of libraries made to help ease developer's life
The newest version!
package io.smooth.constraint
sealed class ConstraintResult(
open val constraints: Array>
)
data class ConstraintsPending(override val constraints: Array>) :
ConstraintResult(constraints) {
override fun equals(other: Any?): Boolean {
return this === other
}
override fun hashCode(): Int {
return System.identityHashCode(this)
}
}
data class ConstraintsMet(override val constraints: Array>) :
ConstraintResult(constraints) {
override fun equals(other: Any?): Boolean {
return this === other
}
override fun hashCode(): Int {
return System.identityHashCode(this)
}
}
data class ConstraintsNotMet(
override val constraints: Array>,
val blockingConstraints: List>
) : ConstraintResult(constraints) {
override fun equals(other: Any?): Boolean {
if (this === other) return true
if (other !is ConstraintsNotMet) return false
if (!constraints.contentEquals(other.constraints)) return false
if (blockingConstraints != other.blockingConstraints) return false
return true
}
override fun hashCode(): Int {
var result = constraints.contentHashCode()
result = 31 * result + blockingConstraints.hashCode()
return result
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy