@@ -11,7 +11,8 @@ internal typealias OutputErrorTransformer<T> = OutputCollector<T>.(ValidationErr
11
11
private val NO_TRANSFORMATION : OutputErrorTransformer <* > = { it }
12
12
13
13
/* *
14
- * Provides collectors' implementations defined in [draft 2020-12](https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-01#section-12.4)
14
+ * Provides collectors' implementations for outputs
15
+ * defined in [draft 2020-12](https://json-schema.org/draft/2020-12/draft-bhutton-json-schema-01#section-12.4)
15
16
*/
16
17
public sealed class OutputCollector <T > private constructor(
17
18
parent : OutputCollector <T >? = null ,
@@ -161,9 +162,8 @@ public sealed class OutputCollector<T> private constructor(
161
162
canCollapse : Boolean ,
162
163
): OutputCollector <Nothing > = DelegateOutputCollector (errorCollector, this )
163
164
164
- override fun withErrorTransformer (transformer : OutputErrorTransformer <Nothing >): OutputCollector <Nothing > {
165
- return DelegateOutputCollector (errorCollector, parent, transformer)
166
- }
165
+ override fun withErrorTransformer (transformer : OutputErrorTransformer <Nothing >): OutputCollector <Nothing > =
166
+ DelegateOutputCollector (errorCollector, parent, transformer)
167
167
168
168
override fun reportErrors () {
169
169
if (! ::reportedErrors.isInitialized) {
@@ -455,14 +455,13 @@ public sealed class OutputCollector<T> private constructor(
455
455
)
456
456
}
457
457
458
- override fun updateLocation (path : JsonPointer ): Verbose {
459
- return Verbose (
458
+ override fun updateLocation (path : JsonPointer ): Verbose =
459
+ Verbose (
460
460
location = path,
461
461
keywordLocation = keywordLocation,
462
462
absoluteLocation = absoluteLocation,
463
463
parent = this ,
464
464
)
465
- }
466
465
467
466
override fun updateKeywordLocation (
468
467
path : JsonPointer ,
@@ -486,9 +485,8 @@ public sealed class OutputCollector<T> private constructor(
486
485
)
487
486
}
488
487
489
- override fun childCollector (): OutputCollector <OutputUnit > {
490
- return Verbose (location, keywordLocation, this , absoluteLocation, child = true )
491
- }
488
+ override fun childCollector (): OutputCollector <OutputUnit > =
489
+ Verbose (location, keywordLocation, this , absoluteLocation, child = true )
492
490
493
491
override fun withErrorTransformer (transformer : OutputErrorTransformer <OutputUnit >): OutputCollector <OutputUnit > =
494
492
Verbose (location, keywordLocation, parent, absoluteLocation, transformer = transformer)
0 commit comments