@@ -34,9 +34,10 @@ private class KPropertyPath<T, U>(
34
34
/* *
35
35
* Abstraction of a property path that consists of parent [KProperty],
36
36
* and child property [KProperty], where parent [parent] has an [Iterable]
37
- * of children, so it represents 1-M mapping, not 1-1, like [KPropertyPath]
37
+ * of children, so it represents 1-M mapping.
38
38
*
39
39
* @author Mikhail Polivakha
40
+ * @since 3.5
40
41
*/
41
42
internal class KIterablePropertyPath <T , U >(
42
43
val parent : KProperty <Iterable <U ?>? >,
@@ -52,8 +53,8 @@ internal fun asString(property: KProperty<*>): String {
52
53
return when (property) {
53
54
is KPropertyPath <* , * > ->
54
55
" ${asString(property.parent)} .${property.child.name} "
55
- is KIterablePropertyPath <* , * > ->
56
- " ${asString(property.parent)} .${property.child.name} "
56
+ is KIterablePropertyPath <* , * > ->
57
+ " ${asString(property.parent)} .${property.child.name} "
57
58
else -> property.name
58
59
}
59
60
}
@@ -81,21 +82,15 @@ operator fun <T, U> KProperty<T?>.div(other: KProperty1<T, U>): KProperty<U> =
81
82
* Note, that this function is different from [div] above in the
82
83
* way that it represents a division operator overloading for
83
84
* child references, where parent to child reference relation is 1-M, not 1-1.
84
- * It implies that parent has an [Iterable] or any liner [Collection] of children.
85
+ * It implies that parent defines a [Collection] of children.
85
86
**
86
- * For example, referring to the field "addresses.street":
87
- * ```
88
- * User::addresses / Author::street contains "Austin"
87
+ * For example, referring to the field "books.title":
89
88
* ```
90
- *
91
- * And the entities may look like this:
92
- * ```
93
- * class User(val addresses: List<Address>)
94
- *
95
- * class Address(val street: String)
89
+ * Author::books / Book::title contains "Bartleby"
96
90
* ```
97
91
* @author Mikhail Polivakha
92
+ * @since 3.5
98
93
*/
99
94
@JvmName(" divIterable" )
100
- operator fun <T , U > KProperty<Iterable <T?>?>.div (other : KProperty1 <T , U >): KProperty <U > =
95
+ operator fun <T , U > KProperty<Collection <T?>?>.div (other : KProperty1 <T , U >): KProperty <U > =
101
96
KIterablePropertyPath (this , other)
0 commit comments