Add a matches function.

This commit is contained in:
Danila Fedorin 2017-08-08 13:46:54 -07:00
parent 5a57544067
commit 8c3de54d0c
1 changed files with 10 additions and 1 deletions

View File

@ -14,4 +14,13 @@ package org.nwapw.abacus.function
*/
data class Documentation(val codeName: String, val name: String,
val description: String, val longDescription: String,
val type: DocumentationType)
val type: DocumentationType) {
fun matches(other: String): Boolean {
return codeName.toLowerCase().contains(other.toLowerCase()) ||
name.toLowerCase().contains(other.toLowerCase()) ||
description.toLowerCase().contains(other.toLowerCase()) ||
longDescription.toLowerCase().contains(other.toLowerCase())
}
}