com.iodesystems.db.search.model.Term.kt Maven / Gradle / Ivy
package com.iodesystems.db.search.model
data class Term(val target: String?, val conjunction: Conjunction, val values: List) {
constructor(target: String?, conjunction: Conjunction, value: String, vararg extra: String) : this(
target,
conjunction,
convert(value, *extra)
)
constructor(conjunction: Conjunction, value: String, vararg extra: String) : this(
null,
conjunction,
convert(value, *extra)
)
constructor(value: String, vararg extra: String) : this(null, Conjunction.AND, convert(value, *extra))
companion object {
private fun convert(value: String, vararg extra: String): List {
val termValues = ArrayList()
termValues.add(TermValue(Conjunction.AND, value))
for (s in extra) {
termValues.add(TermValue(Conjunction.AND, s))
}
return termValues
}
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy