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