1
0
mirror of https://github.com/DanilaFe/abacus synced 2025-04-21 16:18:44 -07:00

Add a matches function.

This commit is contained in:
Danila Fedorin 2017-08-08 13:46:54 -07:00
parent 55afd5fba0
commit 5aa47d9602

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())
}
}