@@ -70,90 +70,65 @@ class DbSetupBuilder(private val to: Destination, var binderConfiguration: Binde
70
70
* Adds a DeleteAll operation to the DbSetup
71
71
* @param table the table to delete from
72
72
*/
73
- fun deleteAllFrom (table : String ) {
74
- execute(Operations .deleteAllFrom(table))
75
- }
73
+ fun deleteAllFrom (table : String ) = execute(Operations .deleteAllFrom(table))
76
74
77
75
/* *
78
76
* Adds DeleteAll operations to the DbSetup
79
77
* @param tables the tables to delete from
80
78
*/
81
- fun deleteAllFrom (vararg tables : String ) {
82
- execute(Operations .deleteAllFrom(* tables))
83
- }
79
+ fun deleteAllFrom (vararg tables : String ) = execute(Operations .deleteAllFrom(* tables))
84
80
85
81
/* *
86
82
* Adds DeleteAll operations to the DbSetup
87
83
* @param tables the tables to delete from
88
84
*/
89
- fun deleteAllFrom (tables : List <String >) {
90
- execute(Operations .deleteAllFrom(tables))
91
- }
85
+ fun deleteAllFrom (tables : List <String >) = execute(Operations .deleteAllFrom(tables))
92
86
93
87
/* *
94
88
* Adds a Truncate operation to the DbSetup
95
89
* @param table the table to truncate
96
90
*/
97
- fun truncate (table : String ) {
98
- execute(Operations .truncate(table))
99
- }
91
+ fun truncate (table : String ) = execute(Operations .truncate(table))
100
92
101
93
/* *
102
94
* Adds Truncate operations to the DbSetup
103
95
* @param tables the tables to delete from
104
96
*/
105
- fun truncate (vararg tables : String ) {
106
- execute(Operations .truncate(* tables))
107
- }
97
+ fun truncate (vararg tables : String ) = execute(Operations .truncate(* tables))
108
98
109
99
/* *
110
100
* Adds Truncate operations to the DbSetup
111
101
* @param tables the tables to truncate
112
102
*/
113
- fun truncate (tables : List <String >) {
114
- execute(Operations .truncate(tables))
115
- }
103
+ fun truncate (tables : List <String >) = execute(Operations .truncate(tables))
116
104
117
105
/* *
118
106
* Adds a SqlOperation to the DbSetup
119
107
* @param statement the SQL statement to execute
120
108
*/
121
- fun sql (statement : String ) {
122
- execute(Operations .sql(statement))
123
- }
109
+ fun sql (statement : String ) = execute(Operations .sql(statement))
124
110
125
111
/* *
126
112
* Adds SqlOperations to the DbSetup
127
113
* @param statements the SQL statements to execute
128
114
*/
129
- fun sql (vararg statements : String ) {
130
- execute(Operations .sql(* statements))
131
- }
115
+ fun sql (vararg statements : String ) = execute(Operations .sql(* statements))
132
116
133
117
/* *
134
118
* Adds SqlOperations to the DbSetup
135
119
* @param statements the SQL statements to execute
136
120
*/
137
- fun sql (statements : List <String >) {
138
- execute(Operations .sql(statements))
139
- }
121
+ fun sql (statements : List <String >) = execute(Operations .sql(statements))
140
122
141
123
/* *
142
124
* Adds an operation to the DbSetup. Custom extension functions typically delegate to this method to
143
125
* add the operation they want.
144
126
* @param operation the operation to add
145
127
*/
146
- fun execute (operation : Operation ) {
147
- operations.add(operation)
148
- }
128
+ fun execute (operation : Operation ) = operations.add(operation)
149
129
150
130
/* *
151
131
* Builds the DbSetup. This method is called by the dbSetup function after the builder has been configured.
152
- * @throws IllegalStateException if the destination has not been set
153
132
*/
154
- internal fun build (): DbSetup {
155
- return DbSetup (to,
156
- Operations .sequenceOf(operations),
157
- binderConfiguration)
158
- }
133
+ internal fun build () = DbSetup (to, Operations .sequenceOf(operations), binderConfiguration)
159
134
}
0 commit comments