
commonMain.com.algolia.search.dsl.ranking.DSLIndexName.kt Maven / Gradle / Ivy
package com.algolia.search.dsl.ranking
import com.algolia.search.dsl.DSL
import com.algolia.search.dsl.DSLParameters
import com.algolia.search.model.IndexName
/**
* DSL for building a [List] of [IndexName].
*/
@DSLParameters
public class DSLIndexName(
private val indexNames: MutableList = mutableListOf()
) {
/**
* Convenience method.
*/
public operator fun String.unaryPlus() {
+IndexName(this)
}
/**
* Add [this] to [indexNames].
*/
public operator fun IndexName.unaryPlus() {
indexNames += this
}
public companion object : DSL> {
override operator fun invoke(block: DSLIndexName.() -> Unit): List {
return DSLIndexName().apply(block).indexNames
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy