Skip to content

Commit 4d1178e

Browse files
committed
DSL methods are Unit methods
1 parent 9435bac commit 4d1178e

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

src/main/kotlin/org/mybatis/dynamic/sql/util/kotlin/KotlinInsertHelpers.kt

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2016-2021 the original author or authors.
2+
* Copyright 2016-2022 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -42,45 +42,44 @@ class KotlinGeneralInsertBuilder(private val dsl: GeneralInsertDSL) : Buildable<
4242

4343
@MyBatisDslMarker
4444
inner class GeneralInsertSetClauseFinisher<T>(private val column: SqlColumn<T>) {
45-
fun toNull(): KotlinGeneralInsertBuilder =
45+
fun toNull(): Unit =
4646
applyToDsl {
4747
set(column).toNull()
4848
}
4949

50-
fun toConstant(constant: String): KotlinGeneralInsertBuilder =
50+
fun toConstant(constant: String): Unit =
5151
applyToDsl {
5252
set(column).toConstant(constant)
5353
}
5454

55-
fun toStringConstant(constant: String): KotlinGeneralInsertBuilder =
55+
fun toStringConstant(constant: String): Unit =
5656
applyToDsl {
5757
set(column).toStringConstant(constant)
5858
}
5959

60-
fun toValue(value: T): KotlinGeneralInsertBuilder = toValue { value }
60+
fun toValue(value: T): Unit = toValue { value }
6161

62-
fun toValue(value: () -> T): KotlinGeneralInsertBuilder =
62+
fun toValue(value: () -> T): Unit =
6363
applyToDsl {
6464
set(column).toValue(value)
6565
}
6666

67-
fun toValueOrNull(value: T?): KotlinGeneralInsertBuilder = toValueOrNull { value }
67+
fun toValueOrNull(value: T?): Unit = toValueOrNull { value }
6868

69-
fun toValueOrNull(value: () -> T?): KotlinGeneralInsertBuilder =
69+
fun toValueOrNull(value: () -> T?): Unit =
7070
applyToDsl {
7171
set(column).toValueOrNull(value)
7272
}
7373

74-
fun toValueWhenPresent(value: T?): KotlinGeneralInsertBuilder = toValueWhenPresent { value }
74+
fun toValueWhenPresent(value: T?): Unit = toValueWhenPresent { value }
7575

76-
fun toValueWhenPresent(value: () -> T?): KotlinGeneralInsertBuilder =
76+
fun toValueWhenPresent(value: () -> T?): Unit =
7777
applyToDsl {
7878
set(column).toValueWhenPresent(value)
7979
}
8080

81-
private fun applyToDsl(block: GeneralInsertDSL.() -> Unit): KotlinGeneralInsertBuilder =
82-
this@KotlinGeneralInsertBuilder.apply {
83-
dsl.apply(block)
84-
}
81+
private fun applyToDsl(block: GeneralInsertDSL.() -> Unit): Unit {
82+
this@KotlinGeneralInsertBuilder.dsl.apply(block)
83+
}
8584
}
8685
}

0 commit comments

Comments
 (0)