@@ -38,10 +38,9 @@ class KSearchedCaseDSL : KElseDSL {
38
38
.withSubCriteria(subCriteria)
39
39
.withThenValue(thenValue)
40
40
.build())
41
-
42
41
}
43
42
44
- override fun `else` (column : BasicColumn ) {
43
+ override infix fun `else` (column : BasicColumn ) {
45
44
this .elseValue = column
46
45
}
47
46
}
@@ -53,7 +52,7 @@ class SearchedCaseCriteriaCollector : GroupingCriteriaCollector(), KThenDSL {
53
52
field = value
54
53
}
55
54
56
- override fun then (column : BasicColumn ) {
55
+ override infix fun then (column : BasicColumn ) {
57
56
thenValue = column
58
57
}
59
58
}
@@ -67,26 +66,26 @@ class KSimpleCaseDSL<T : Any> : KElseDSL {
67
66
internal val whenConditions = mutableListOf<SimpleCaseWhenCondition <T >>()
68
67
69
68
fun `when` (firstCondition : VisitableCondition <T >, vararg subsequentConditions : VisitableCondition <T >) =
70
- SimpleCaseThenGatherer {
69
+ SimpleCaseThenGatherer { thenValue ->
71
70
val allConditions = buildList {
72
71
add(firstCondition)
73
72
addAll(subsequentConditions)
74
73
}
75
74
76
- whenConditions.add(ConditionBasedWhenCondition (allConditions, it ))
75
+ whenConditions.add(ConditionBasedWhenCondition (allConditions, thenValue ))
77
76
}
78
77
79
78
fun `when` (firstValue : T , vararg subsequentValues : T ) =
80
- SimpleCaseThenGatherer {
79
+ SimpleCaseThenGatherer { thenValue ->
81
80
val allConditions = buildList {
82
81
add(firstValue)
83
82
addAll(subsequentValues)
84
83
}
85
84
86
- whenConditions.add(BasicWhenCondition (allConditions, it ))
85
+ whenConditions.add(BasicWhenCondition (allConditions, thenValue ))
87
86
}
88
87
89
- override fun `else` (column : BasicColumn ) {
88
+ override infix fun `else` (column : BasicColumn ) {
90
89
this .elseValue = column
91
90
}
92
91
}
@@ -122,25 +121,25 @@ interface KThenDSL {
122
121
}
123
122
124
123
interface KElseDSL {
125
- fun `else` (value : String ) {
124
+ infix fun `else` (value : String ) {
126
125
`else `(stringConstant(value))
127
126
}
128
127
129
- fun `else` (value : Boolean ) {
128
+ infix fun `else` (value : Boolean ) {
130
129
`else `(constant<String >(value.toString()))
131
130
}
132
131
133
- fun `else` (value : Int ) {
132
+ infix fun `else` (value : Int ) {
134
133
`else `(constant<String >(value.toString()))
135
134
}
136
135
137
- fun `else` (value : Long ) {
136
+ infix fun `else` (value : Long ) {
138
137
`else `(constant<String >(value.toString()))
139
138
}
140
139
141
- fun `else` (value : Double ) {
140
+ infix fun `else` (value : Double ) {
142
141
`else `(constant<String >(value.toString()))
143
142
}
144
143
145
- fun `else` (column : BasicColumn )
144
+ infix fun `else` (column : BasicColumn )
146
145
}
0 commit comments