Skip to content

Commit 6946b5d

Browse files
committed
Polishing.
Reorder methods and query options alphabetically. Update since tags. See #1220
1 parent 367b6ac commit 6946b5d

File tree

9 files changed

+349
-336
lines changed

9 files changed

+349
-336
lines changed

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/DeleteOptions.java

Lines changed: 39 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,14 @@ public class DeleteOptions extends WriteOptions {
4848
private final @Nullable Filter ifCondition;
4949

5050
private DeleteOptions(@Nullable ConsistencyLevel consistencyLevel, ExecutionProfileResolver executionProfileResolver,
51-
@Nullable CqlIdentifier keyspace, @Nullable Integer pageSize, @Nullable ConsistencyLevel serialConsistencyLevel,
51+
@Nullable Boolean idempotent, @Nullable CqlIdentifier keyspace, @Nullable Integer pageSize,
52+
@Nullable CqlIdentifier routingKeyspace, @Nullable ByteBuffer routingKey,
53+
@Nullable ConsistencyLevel serialConsistencyLevel,
5254
Duration timeout, Duration ttl, @Nullable Long timestamp, @Nullable Boolean tracing, boolean ifExists,
53-
@Nullable Filter ifCondition, @Nullable Boolean idempotent, @Nullable CqlIdentifier routingKeyspace,
54-
@Nullable ByteBuffer routingKey) {
55+
@Nullable Filter ifCondition) {
5556

56-
super(consistencyLevel, executionProfileResolver, keyspace, pageSize, serialConsistencyLevel, timeout, ttl,
57-
timestamp, tracing, idempotent, routingKeyspace, routingKey);
57+
super(consistencyLevel, executionProfileResolver, idempotent, keyspace, pageSize, routingKeyspace, routingKey,
58+
serialConsistencyLevel, timeout, ttl, timestamp, tracing);
5859

5960
this.ifExists = ifExists;
6061
this.ifCondition = ifCondition;
@@ -201,6 +202,16 @@ public DeleteOptionsBuilder fetchSize(int fetchSize) {
201202
return this;
202203
}
203204

205+
/* (non-Javadoc)
206+
* @see org.springframework.data.cassandra.core.cql.WriteOptions.WriteOptionsBuilder#idempotent(boolean)
207+
*/
208+
@Override
209+
public DeleteOptionsBuilder idempotent(boolean idempotent) {
210+
211+
super.idempotent(idempotent);
212+
return this;
213+
}
214+
204215
/* (non-Javadoc)
205216
* @see org.springframework.data.cassandra.core.cql.WriteOptions.WriteOptionsBuilder#keyspace()
206217
*/
@@ -243,6 +254,26 @@ public DeleteOptionsBuilder readTimeout(long readTimeout, TimeUnit timeUnit) {
243254
return this;
244255
}
245256

257+
/* (non-Javadoc)
258+
* @see org.springframework.data.cassandra.core.cql.QueryOptions.QueryOptionsBuilder#routingKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier)
259+
*/
260+
@Override
261+
public DeleteOptionsBuilder routingKeyspace(CqlIdentifier routingKeyspace) {
262+
263+
super.routingKeyspace(routingKeyspace);
264+
return this;
265+
}
266+
267+
/* (non-Javadoc)
268+
* @see org.springframework.data.cassandra.core.cql.QueryOptions.QueryOptionsBuilder#routingKeyspace(java.nio.ByteBuffer)
269+
*/
270+
@Override
271+
public DeleteOptionsBuilder routingKey(ByteBuffer routingKey) {
272+
273+
super.routingKey(routingKey);
274+
return this;
275+
}
276+
246277
/* (non-Javadoc)
247278
* @see org.springframework.data.cassandra.core.cql.QueryOptions.QueryOptionsBuilder#serialConsistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel)
248279
*/
@@ -292,16 +323,6 @@ public DeleteOptionsBuilder withTracing() {
292323
return this;
293324
}
294325

295-
/* (non-Javadoc)
296-
* @see org.springframework.data.cassandra.core.cql.WriteOptions.WriteOptionsBuilder#idempotent(boolean)
297-
*/
298-
@Override
299-
public DeleteOptionsBuilder idempotent(boolean idempotent) {
300-
301-
super.idempotent(idempotent);
302-
return this;
303-
}
304-
305326
/* (non-Javadoc)
306327
* @see org.springframework.data.cassandra.core.cql.WriteOptions.WriteOptionsBuilder#ttl(int)
307328
*/
@@ -331,26 +352,6 @@ public DeleteOptionsBuilder timestamp(Instant timestamp) {
331352
return this;
332353
}
333354

334-
/* (non-Javadoc)
335-
* @see org.springframework.data.cassandra.core.cql.QueryOptions.QueryOptionsBuilder#routingKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier)
336-
*/
337-
@Override
338-
public DeleteOptionsBuilder routingKeyspace(CqlIdentifier routingKeyspace) {
339-
340-
super.routingKeyspace(routingKeyspace);
341-
return this;
342-
}
343-
344-
/* (non-Javadoc)
345-
* @see org.springframework.data.cassandra.core.cql.QueryOptions.QueryOptionsBuilder#routingKeyspace(java.nio.ByteBuffer)
346-
*/
347-
@Override
348-
public DeleteOptionsBuilder routingKey(ByteBuffer routingKey) {
349-
350-
super.routingKey(routingKey);
351-
return this;
352-
}
353-
354355
/**
355356
* Use light-weight transactions by applying {@code IF EXISTS}. Replaces a previous {@link #ifCondition(Filter)}.
356357
*
@@ -412,9 +413,9 @@ public DeleteOptionsBuilder ifCondition(Filter condition) {
412413
*/
413414
public DeleteOptions build() {
414415

415-
return new DeleteOptions(this.consistencyLevel, this.executionProfileResolver, this.keyspace, this.pageSize,
416-
this.serialConsistencyLevel, this.timeout, this.ttl, this.timestamp, this.tracing, this.ifExists,
417-
this.ifCondition, this.idempotent, this.routingKeyspace, this.routingKey);
416+
return new DeleteOptions(this.consistencyLevel, this.executionProfileResolver, this.idempotent, this.keyspace,
417+
this.pageSize, this.routingKeyspace, this.routingKey, this.serialConsistencyLevel, this.timeout, this.ttl,
418+
this.timestamp, this.tracing, this.ifExists, this.ifCondition);
418419
}
419420
}
420421
}

spring-data-cassandra/src/main/java/org/springframework/data/cassandra/core/InsertOptions.java

Lines changed: 39 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,14 @@ public class InsertOptions extends WriteOptions {
4545
private final boolean insertNulls;
4646

4747
private InsertOptions(@Nullable ConsistencyLevel consistencyLevel, ExecutionProfileResolver executionProfileResolver,
48-
@Nullable CqlIdentifier keyspace, @Nullable Integer pageSize, @Nullable ConsistencyLevel serialConsistencyLevel,
48+
@Nullable Boolean idempotent, @Nullable CqlIdentifier keyspace, @Nullable Integer pageSize,
49+
@Nullable CqlIdentifier routingKeyspace, @Nullable ByteBuffer routingKey,
50+
@Nullable ConsistencyLevel serialConsistencyLevel,
4951
Duration timeout, Duration ttl, @Nullable Long timestamp, @Nullable Boolean tracing, boolean ifNotExists,
50-
boolean insertNulls, @Nullable Boolean idempotent, @Nullable CqlIdentifier routingKeyspace,
51-
@Nullable ByteBuffer routingKey) {
52+
boolean insertNulls) {
5253

53-
super(consistencyLevel, executionProfileResolver, keyspace, pageSize, serialConsistencyLevel, timeout, ttl,
54-
timestamp, tracing, idempotent, routingKeyspace, routingKey);
54+
super(consistencyLevel, executionProfileResolver, idempotent, keyspace, pageSize, routingKeyspace, routingKey,
55+
serialConsistencyLevel, timeout, ttl, timestamp, tracing);
5556

5657
this.ifNotExists = ifNotExists;
5758
this.insertNulls = insertNulls;
@@ -201,6 +202,16 @@ public InsertOptionsBuilder fetchSize(int fetchSize) {
201202
return (InsertOptionsBuilder) super.fetchSize(fetchSize);
202203
}
203204

205+
/* (non-Javadoc)
206+
* @see org.springframework.data.cassandra.core.cql.QueryOptions.QueryOptionsBuilder#idempotent(boolean)
207+
*/
208+
@Override
209+
public InsertOptionsBuilder idempotent(boolean idempotent) {
210+
211+
super.idempotent(idempotent);
212+
return this;
213+
}
214+
204215
/* (non-Javadoc)
205216
* @see org.springframework.data.cassandra.core.cql.WriteOptions.WriteOptionsBuilder#keyspace()
206217
*/
@@ -241,6 +252,26 @@ public InsertOptionsBuilder readTimeout(long readTimeout, TimeUnit timeUnit) {
241252
return this;
242253
}
243254

255+
/* (non-Javadoc)
256+
* @see org.springframework.data.cassandra.core.cql.QueryOptions.QueryOptionsBuilder#routingKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier)
257+
*/
258+
@Override
259+
public InsertOptionsBuilder routingKeyspace(CqlIdentifier routingKeyspace) {
260+
261+
super.routingKeyspace(routingKeyspace);
262+
return this;
263+
}
264+
265+
/* (non-Javadoc)
266+
* @see org.springframework.data.cassandra.core.cql.QueryOptions.QueryOptionsBuilder#routingKeyspace(java.nio.ByteBuffer)
267+
*/
268+
@Override
269+
public InsertOptionsBuilder routingKey(ByteBuffer routingKey) {
270+
271+
super.routingKey(routingKey);
272+
return this;
273+
}
274+
244275
/* (non-Javadoc)
245276
* @see org.springframework.data.cassandra.core.cql.QueryOptions.QueryOptionsBuilder#serialConsistencyLevel(com.datastax.oss.driver.api.core.ConsistencyLevel)
246277
*/
@@ -320,36 +351,6 @@ public InsertOptionsBuilder timestamp(Instant timestamp) {
320351
return this;
321352
}
322353

323-
/* (non-Javadoc)
324-
* @see org.springframework.data.cassandra.core.cql.QueryOptions.QueryOptionsBuilder#idempotent(boolean)
325-
*/
326-
@Override
327-
public InsertOptionsBuilder idempotent(boolean idempotent) {
328-
329-
super.idempotent(idempotent);
330-
return this;
331-
}
332-
333-
/* (non-Javadoc)
334-
* @see org.springframework.data.cassandra.core.cql.QueryOptions.QueryOptionsBuilder#routingKeyspace(com.datastax.oss.driver.api.core.CqlIdentifier)
335-
*/
336-
@Override
337-
public InsertOptionsBuilder routingKeyspace(CqlIdentifier routingKeyspace) {
338-
339-
super.routingKeyspace(routingKeyspace);
340-
return this;
341-
}
342-
343-
/* (non-Javadoc)
344-
* @see org.springframework.data.cassandra.core.cql.QueryOptions.QueryOptionsBuilder#routingKeyspace(java.nio.ByteBuffer)
345-
*/
346-
@Override
347-
public InsertOptionsBuilder routingKey(ByteBuffer routingKey) {
348-
349-
super.routingKey(routingKey);
350-
return this;
351-
}
352-
353354
/**
354355
* Use light-weight transactions by applying {@code IF NOT EXISTS}.
355356
*
@@ -406,9 +407,10 @@ public InsertOptionsBuilder withInsertNulls(boolean insertNulls) {
406407
* @return a new {@link InsertOptions} with the configured values
407408
*/
408409
public InsertOptions build() {
409-
return new InsertOptions(this.consistencyLevel, this.executionProfileResolver, this.keyspace, this.pageSize,
410+
return new InsertOptions(this.consistencyLevel, this.executionProfileResolver, this.idempotent, this.keyspace,
411+
this.pageSize, this.routingKeyspace, this.routingKey,
410412
this.serialConsistencyLevel, this.timeout, this.ttl, this.timestamp, this.tracing, this.ifNotExists,
411-
this.insertNulls, this.idempotent, this.routingKeyspace, this.routingKey);
413+
this.insertNulls);
412414
}
413415
}
414416
}

0 commit comments

Comments
 (0)