Skip to content

Commit 366184e

Browse files
authored
BatchOperation: add private modifier to values and yieldAllowed; provide public values getter for testing (#16)
1 parent 2a45226 commit 366184e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

lib/src/main/kotlin/at/bitfire/synctools/storage/BatchOperation.kt

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -233,11 +233,13 @@ open class BatchOperation internal constructor(
233233
private var selection: String? = null
234234
private var selectionArguments: Array<String>? = null
235235

236-
internal val values = mutableMapOf<String, Any?>()
236+
private val _values = mutableMapOf<String, Any?>()
237+
val values
238+
get() = _values.toMap()
239+
237240
internal val valueBackrefs = mutableMapOf<String, BackReference>()
238241

239-
@VisibleForTesting
240-
internal var yieldAllowed = false
242+
private var yieldAllowed = false
241243

242244

243245
fun withSelection(select: String, args: Array<String>): CpoBuilder {
@@ -258,7 +260,7 @@ open class BatchOperation internal constructor(
258260
}
259261

260262
fun withValue(key: String, value: Any?): CpoBuilder {
261-
values[key] = value
263+
_values[key] = value
262264
return this
263265
}
264266

0 commit comments

Comments
 (0)