19
19
20
20
import org .springframework .data .cassandra .core .cql .QueryOptions ;
21
21
import org .springframework .data .cassandra .core .cql .WriteOptions ;
22
+ import org .springframework .lang .Contract ;
22
23
import org .springframework .util .Assert ;
23
24
24
25
import com .datastax .oss .driver .api .core .cql .BatchableStatement ;
@@ -58,6 +59,7 @@ public interface CassandraBatchOperations {
58
59
* @return {@code this} {@link CassandraBatchOperations}.
59
60
* @throws IllegalStateException if the batch was already executed.
60
61
*/
62
+ @ Contract ("_ -> this" )
61
63
CassandraBatchOperations withTimestamp (long timestamp );
62
64
63
65
/**
@@ -68,6 +70,7 @@ public interface CassandraBatchOperations {
68
70
* @throws IllegalStateException if the batch was already executed.
69
71
* @since 4.4
70
72
*/
73
+ @ Contract ("_ -> this" )
71
74
CassandraBatchOperations withQueryOptions (QueryOptions options );
72
75
73
76
/**
@@ -78,6 +81,7 @@ public interface CassandraBatchOperations {
78
81
* @throws IllegalStateException if the batch was already executed.
79
82
* @since 4.4
80
83
*/
84
+ @ Contract ("_ -> this" )
81
85
CassandraBatchOperations addStatement (BatchableStatement <?> statement );
82
86
83
87
/**
@@ -88,6 +92,7 @@ public interface CassandraBatchOperations {
88
92
* @throws IllegalStateException if the batch was already executed.
89
93
* @since 4.4
90
94
*/
95
+ @ Contract ("_ -> this" )
91
96
CassandraBatchOperations addStatements (BatchableStatement <?>... statements );
92
97
93
98
/**
@@ -98,6 +103,7 @@ public interface CassandraBatchOperations {
98
103
* @throws IllegalStateException if the batch was already executed.
99
104
* @since 4.4
100
105
*/
106
+ @ Contract ("_ -> this" )
101
107
CassandraBatchOperations addStatements (Iterable <? extends BatchableStatement <?>> statements );
102
108
103
109
/**
@@ -109,6 +115,7 @@ public interface CassandraBatchOperations {
109
115
* @throws IllegalStateException if the batch was already executed.
110
116
* @since 3.2.2
111
117
*/
118
+ @ Contract ("_, _ -> this" )
112
119
default CassandraBatchOperations insert (Object entity , WriteOptions options ) {
113
120
114
121
Assert .notNull (entity , "Entity must not be null" );
@@ -123,6 +130,7 @@ default CassandraBatchOperations insert(Object entity, WriteOptions options) {
123
130
* @return {@code this} {@link CassandraBatchOperations}.
124
131
* @throws IllegalStateException if the batch was already executed.
125
132
*/
133
+ @ Contract ("_ -> this" )
126
134
CassandraBatchOperations insert (Object ... entities );
127
135
128
136
/**
@@ -132,6 +140,7 @@ default CassandraBatchOperations insert(Object entity, WriteOptions options) {
132
140
* @return {@code this} {@link CassandraBatchOperations}.
133
141
* @throws IllegalStateException if the batch was already executed.
134
142
*/
143
+ @ Contract ("_ -> this" )
135
144
CassandraBatchOperations insert (Iterable <?> entities );
136
145
137
146
/**
@@ -144,6 +153,7 @@ default CassandraBatchOperations insert(Object entity, WriteOptions options) {
144
153
* @since 2.0
145
154
* @see InsertOptions
146
155
*/
156
+ @ Contract ("_, _ -> this" )
147
157
CassandraBatchOperations insert (Iterable <?> entities , WriteOptions options );
148
158
149
159
/**
@@ -155,6 +165,7 @@ default CassandraBatchOperations insert(Object entity, WriteOptions options) {
155
165
* @throws IllegalStateException if the batch was already executed.
156
166
* @since 3.2.2
157
167
*/
168
+ @ Contract ("_, _ -> this" )
158
169
default CassandraBatchOperations update (Object entity , WriteOptions options ) {
159
170
160
171
Assert .notNull (entity , "Entity must not be null" );
@@ -169,6 +180,7 @@ default CassandraBatchOperations update(Object entity, WriteOptions options) {
169
180
* @return {@code this} {@link CassandraBatchOperations}.
170
181
* @throws IllegalStateException if the batch was already executed.
171
182
*/
183
+ @ Contract ("_ -> this" )
172
184
CassandraBatchOperations update (Object ... entities );
173
185
174
186
/**
@@ -178,6 +190,7 @@ default CassandraBatchOperations update(Object entity, WriteOptions options) {
178
190
* @return {@code this} {@link CassandraBatchOperations}.
179
191
* @throws IllegalStateException if the batch was already executed.
180
192
*/
193
+ @ Contract ("_ -> this" )
181
194
CassandraBatchOperations update (Iterable <?> entities );
182
195
183
196
/**
@@ -190,6 +203,7 @@ default CassandraBatchOperations update(Object entity, WriteOptions options) {
190
203
* @since 2.0
191
204
* @see UpdateOptions
192
205
*/
206
+ @ Contract ("_, _ -> this" )
193
207
CassandraBatchOperations update (Iterable <?> entities , WriteOptions options );
194
208
195
209
/**
@@ -201,6 +215,7 @@ default CassandraBatchOperations update(Object entity, WriteOptions options) {
201
215
* @throws IllegalStateException if the batch was already executed.
202
216
* @since 3.2.2
203
217
*/
218
+ @ Contract ("_, _ -> this" )
204
219
default CassandraBatchOperations delete (Object entity , WriteOptions options ) {
205
220
206
221
Assert .notNull (entity , "Entity must not be null" );
@@ -215,6 +230,7 @@ default CassandraBatchOperations delete(Object entity, WriteOptions options) {
215
230
* @return {@code this} {@link CassandraBatchOperations}.
216
231
* @throws IllegalStateException if the batch was already executed.
217
232
*/
233
+ @ Contract ("_ -> this" )
218
234
CassandraBatchOperations delete (Object ... entities );
219
235
220
236
/**
@@ -224,6 +240,7 @@ default CassandraBatchOperations delete(Object entity, WriteOptions options) {
224
240
* @return {@code this} {@link CassandraBatchOperations}.
225
241
* @throws IllegalStateException if the batch was already executed.
226
242
*/
243
+ @ Contract ("_ -> this" )
227
244
CassandraBatchOperations delete (Iterable <?> entities );
228
245
229
246
/**
@@ -236,5 +253,6 @@ default CassandraBatchOperations delete(Object entity, WriteOptions options) {
236
253
* @since 2.2
237
254
* @see DeleteOptions
238
255
*/
256
+ @ Contract ("_, _ -> this" )
239
257
CassandraBatchOperations delete (Iterable <?> entities , WriteOptions options );
240
258
}
0 commit comments