diff --git a/spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/CriteriaExtensions.kt b/spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/CriteriaExtensions.kt index f3e8c5c6b7..112eb014a4 100644 --- a/spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/CriteriaExtensions.kt +++ b/spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/CriteriaExtensions.kt @@ -32,7 +32,7 @@ fun Criteria.isEqualTo(o: Any?): Criteria = `is`(o) * @author Sebastien Deleuze * @since 2.0 */ -fun Criteria.inValues(c: Collection): Criteria = `in`(c) +fun <@Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") @kotlin.internal.OnlyInputTypes T : Any?> Criteria.inValues(c: Collection): Criteria = `in`(c) /** * Extension for [Criteria.in] providing an `inValues` alias since `in` is a reserved keyword in Kotlin. diff --git a/spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/TypedCriteriaExtensions.kt b/spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/TypedCriteriaExtensions.kt index ee1c102b6d..36a5d38eb3 100644 --- a/spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/TypedCriteriaExtensions.kt +++ b/spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/TypedCriteriaExtensions.kt @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") package org.springframework.data.mongodb.core.query import org.bson.BsonRegularExpression @@ -31,7 +32,7 @@ import kotlin.reflect.KProperty * @since 2.2 * @see Criteria.isEqualTo */ -infix fun KProperty.isEqualTo(value: T) = +infix fun <@kotlin.internal.OnlyInputTypes T> KProperty.isEqualTo(value: T) = Criteria(this.toDotPath()).isEqualTo(value) /** @@ -42,7 +43,7 @@ infix fun KProperty.isEqualTo(value: T) = * @since 2.2 * @see Criteria.ne */ -infix fun KProperty.ne(value: T): Criteria = +infix fun <@kotlin.internal.OnlyInputTypes T> KProperty.ne(value: T): Criteria = Criteria(this.toDotPath()).ne(value) /** @@ -53,7 +54,7 @@ infix fun KProperty.ne(value: T): Criteria = * @since 2.2 * @see Criteria.lt */ -infix fun KProperty.lt(value: Any): Criteria = +infix fun <@kotlin.internal.OnlyInputTypes T> KProperty.lt(value: Any): Criteria = Criteria(this.toDotPath()).lt(value) /** @@ -64,7 +65,7 @@ infix fun KProperty.lt(value: Any): Criteria = * @since 2.2 * @see Criteria.lte */ -infix fun KProperty.lte(value: Any): Criteria = +infix fun <@kotlin.internal.OnlyInputTypes T> KProperty.lte(value: Any): Criteria = Criteria(this.toDotPath()).lte(value) /** @@ -75,7 +76,7 @@ infix fun KProperty.lte(value: Any): Criteria = * @since 2.2 * @see Criteria.gt */ -infix fun KProperty.gt(value: Any): Criteria = +infix fun <@kotlin.internal.OnlyInputTypes T> KProperty.gt(value: Any): Criteria = Criteria(this.toDotPath()).gt(value) /** @@ -86,7 +87,7 @@ infix fun KProperty.gt(value: Any): Criteria = * @since 2.2 * @see Criteria.gte */ -infix fun KProperty.gte(value: Any): Criteria = +infix fun <@kotlin.internal.OnlyInputTypes T> KProperty.gte(value: Any): Criteria = Criteria(this.toDotPath()).gte(value) /** @@ -97,7 +98,7 @@ infix fun KProperty.gte(value: Any): Criteria = * @since 2.2 * @see Criteria.inValues */ -fun KProperty.inValues(vararg o: Any): Criteria = +fun <@kotlin.internal.OnlyInputTypes T> KProperty.inValues(vararg o: Any): Criteria = Criteria(this.toDotPath()).`in`(*o) /** @@ -108,7 +109,7 @@ fun KProperty.inValues(vararg o: Any): Criteria = * @since 2.2 * @see Criteria.inValues */ -infix fun KProperty.inValues(value: Collection): Criteria = +infix fun <@kotlin.internal.OnlyInputTypes T> KProperty.inValues(value: Collection): Criteria = Criteria(this.toDotPath()).`in`(value) /** @@ -119,7 +120,7 @@ infix fun KProperty.inValues(value: Collection): Criteria = * @since 2.2 * @see Criteria.nin */ -fun KProperty.nin(vararg o: Any): Criteria = +fun <@kotlin.internal.OnlyInputTypes T> KProperty.nin(vararg o: Any): Criteria = Criteria(this.toDotPath()).nin(*o) /** @@ -130,7 +131,7 @@ fun KProperty.nin(vararg o: Any): Criteria = * @since 2.2 * @see Criteria.nin */ -infix fun KProperty.nin(value: Collection): Criteria = +infix fun <@kotlin.internal.OnlyInputTypes T> KProperty.nin(value: Collection): Criteria = Criteria(this.toDotPath()).nin(value) /** diff --git a/spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/TypedUpdateExtensions.kt b/spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/TypedUpdateExtensions.kt index e6d06386a1..24943961b5 100644 --- a/spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/TypedUpdateExtensions.kt +++ b/spring-data-mongodb/src/main/kotlin/org/springframework/data/mongodb/core/query/TypedUpdateExtensions.kt @@ -13,6 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ +@file:Suppress("INVISIBLE_MEMBER", "INVISIBLE_REFERENCE") package org.springframework.data.mongodb.core.query import org.springframework.data.mapping.toDotPath @@ -26,7 +27,7 @@ import kotlin.reflect.KProperty * @since 4.4 * @see Update.update */ -fun update(key: KProperty, value: T?) = +fun <@kotlin.internal.OnlyInputTypes T> update(key: KProperty, value: T?) = Update.update(key.toDotPath(), value) /** @@ -36,7 +37,7 @@ fun update(key: KProperty, value: T?) = * @since 4.4 * @see Update.set */ -fun Update.set(key: KProperty, value: T?) = +fun <@kotlin.internal.OnlyInputTypes T> Update.set(key: KProperty, value: T?) = set(key.toDotPath(), value) /** @@ -46,7 +47,7 @@ fun Update.set(key: KProperty, value: T?) = * @since 4.4 * @see Update.setOnInsert */ -fun Update.setOnInsert(key: KProperty, value: T?) = +fun <@kotlin.internal.OnlyInputTypes T> Update.setOnInsert(key: KProperty, value: T?) = setOnInsert(key.toDotPath(), value) /** @@ -56,7 +57,7 @@ fun Update.setOnInsert(key: KProperty, value: T?) = * @since 4.4 * @see Update.unset */ -fun Update.unset(key: KProperty) = +fun <@kotlin.internal.OnlyInputTypes T> Update.unset(key: KProperty) = unset(key.toDotPath()) /** @@ -66,10 +67,10 @@ fun Update.unset(key: KProperty) = * @since 4.4 * @see Update.inc */ -fun Update.inc(key: KProperty, inc: Number) = +fun <@kotlin.internal.OnlyInputTypes T> Update.inc(key: KProperty, inc: Number) = inc(key.toDotPath(), inc) -fun Update.inc(key: KProperty) = +fun <@kotlin.internal.OnlyInputTypes T> Update.inc(key: KProperty) = inc(key.toDotPath()) /** @@ -79,7 +80,7 @@ fun Update.inc(key: KProperty) = * @since 4.4 * @see Update.push */ -fun Update.push(key: KProperty>, value: T?) = +fun <@kotlin.internal.OnlyInputTypes T> Update.push(key: KProperty>, value: T?) = push(key.toDotPath(), value) /** @@ -91,7 +92,7 @@ fun Update.push(key: KProperty>, value: T?) = * @since 4.4 * @see Update.push */ -fun Update.push(key: KProperty) = +fun <@kotlin.internal.OnlyInputTypes T> Update.push(key: KProperty) = push(key.toDotPath()) /** @@ -102,7 +103,7 @@ fun Update.push(key: KProperty) = * @since 4.4 * @see Update.addToSet */ -fun Update.addToSet(key: KProperty) = +fun <@kotlin.internal.OnlyInputTypes T> Update.addToSet(key: KProperty) = addToSet(key.toDotPath()) /** @@ -112,7 +113,7 @@ fun Update.addToSet(key: KProperty) = * @since 4.4 * @see Update.addToSet */ -fun Update.addToSet(key: KProperty>, value: T?) = +fun <@kotlin.internal.OnlyInputTypes T> Update.addToSet(key: KProperty>, value: T?) = addToSet(key.toDotPath(), value) /** @@ -122,7 +123,7 @@ fun Update.addToSet(key: KProperty>, value: T?) = * @since 4.4 * @see Update.pop */ -fun Update.pop(key: KProperty, pos: Position) = +fun <@kotlin.internal.OnlyInputTypes T> Update.pop(key: KProperty, pos: Position) = pop(key.toDotPath(), pos) /** @@ -132,7 +133,7 @@ fun Update.pop(key: KProperty, pos: Position) = * @since 4.4 * @see Update.pull */ -fun Update.pull(key: KProperty, value: Any) = +fun <@kotlin.internal.OnlyInputTypes T> Update.pull(key: KProperty, value: Any) = pull(key.toDotPath(), value) /** @@ -142,7 +143,7 @@ fun Update.pull(key: KProperty, value: Any) = * @since 4.4 * @see Update.pullAll */ -fun Update.pullAll(key: KProperty>, values: Array) = +fun <@kotlin.internal.OnlyInputTypes T> Update.pullAll(key: KProperty>, values: Array) = pullAll(key.toDotPath(), values) /** @@ -152,7 +153,7 @@ fun Update.pullAll(key: KProperty>, values: Array) = * @since 4.4 * @see Update.currentDate */ -fun Update.currentDate(key: KProperty) = +fun <@kotlin.internal.OnlyInputTypes T> Update.currentDate(key: KProperty) = currentDate(key.toDotPath()) /** @@ -162,7 +163,7 @@ fun Update.currentDate(key: KProperty) = * @since 4.4 * @see Update.currentTimestamp */ -fun Update.currentTimestamp(key: KProperty) = +fun <@kotlin.internal.OnlyInputTypes T> Update.currentTimestamp(key: KProperty) = currentTimestamp(key.toDotPath()) /** @@ -172,7 +173,7 @@ fun Update.currentTimestamp(key: KProperty) = * @since 4.4 * @see Update.multiply */ -fun Update.multiply(key: KProperty, multiplier: Number) = +fun <@kotlin.internal.OnlyInputTypes T> Update.multiply(key: KProperty, multiplier: Number) = multiply(key.toDotPath(), multiplier) /** @@ -202,7 +203,7 @@ fun Update.min(key: KProperty, value: T) = * @since 4.4 * @see Update.bitwise */ -fun Update.bitwise(key: KProperty) = +fun <@kotlin.internal.OnlyInputTypes T> Update.bitwise(key: KProperty) = bitwise(key.toDotPath()) /** @@ -213,7 +214,7 @@ fun Update.bitwise(key: KProperty) = * @since 4.4 * @see Update.filterArray */ -fun Update.filterArray(identifier: KProperty, expression: Any) = +fun <@kotlin.internal.OnlyInputTypes T> Update.filterArray(identifier: KProperty, expression: Any) = filterArray(identifier.toDotPath(), expression) /** @@ -223,6 +224,6 @@ fun Update.filterArray(identifier: KProperty, expression: Any) = * @since 4.4 * @see Update.modifies */ -fun Update.modifies(key: KProperty) = +fun <@kotlin.internal.OnlyInputTypes T> Update.modifies(key: KProperty) = modifies(key.toDotPath())