Commit 14bce64f authored by Him188's avatar Him188

Fix `PlainText.equals`, close #192

parent b4f77454
...@@ -33,6 +33,14 @@ class PlainText(val stringValue: String) : ...@@ -33,6 +33,14 @@ class PlainText(val stringValue: String) :
override operator fun contains(sub: String): Boolean = sub in stringValue override operator fun contains(sub: String): Boolean = sub in stringValue
override fun toString(): String = stringValue override fun toString(): String = stringValue
override fun equals(other: Any?): Boolean {
return other is PlainText && other.stringValue == this.stringValue
}
override fun hashCode(): Int {
return stringValue.hashCode()
}
companion object Key : Message.Key<PlainText> companion object Key : Message.Key<PlainText>
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment