Skip to content

Commit d5106b6

Browse files
committed
Polishing.
Reorder methods and query options alphabetically. Update since tags. See #1220
1 parent 96d7e9f commit d5106b6

File tree

9 files changed

+313
-300
lines changed

9 files changed

+313
-300
lines changed

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

Lines changed: 30 additions & 29 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;
@@ -181,6 +182,13 @@ public DeleteOptionsBuilder fetchSize(int fetchSize) {
181182
return this;
182183
}
183184

185+
@Override
186+
public DeleteOptionsBuilder idempotent(boolean idempotent) {
187+
188+
super.idempotent(idempotent);
189+
return this;
190+
}
191+
184192
@Override
185193
public DeleteOptionsBuilder keyspace(CqlIdentifier keyspace) {
186194

@@ -211,6 +219,20 @@ public DeleteOptionsBuilder readTimeout(long readTimeout, TimeUnit timeUnit) {
211219
return this;
212220
}
213221

222+
@Override
223+
public DeleteOptionsBuilder routingKeyspace(CqlIdentifier routingKeyspace) {
224+
225+
super.routingKeyspace(routingKeyspace);
226+
return this;
227+
}
228+
229+
@Override
230+
public DeleteOptionsBuilder routingKey(ByteBuffer routingKey) {
231+
232+
super.routingKey(routingKey);
233+
return this;
234+
}
235+
214236
@Override
215237
public DeleteOptionsBuilder serialConsistencyLevel(ConsistencyLevel consistencyLevel) {
216238
super.serialConsistencyLevel(consistencyLevel);
@@ -245,13 +267,6 @@ public DeleteOptionsBuilder withTracing() {
245267
return this;
246268
}
247269

248-
@Override
249-
public DeleteOptionsBuilder idempotent(boolean idempotent) {
250-
251-
super.idempotent(idempotent);
252-
return this;
253-
}
254-
255270
public DeleteOptionsBuilder ttl(int ttl) {
256271

257272
super.ttl(ttl);
@@ -272,20 +287,6 @@ public DeleteOptionsBuilder timestamp(Instant timestamp) {
272287
return this;
273288
}
274289

275-
@Override
276-
public DeleteOptionsBuilder routingKeyspace(CqlIdentifier routingKeyspace) {
277-
278-
super.routingKeyspace(routingKeyspace);
279-
return this;
280-
}
281-
282-
@Override
283-
public DeleteOptionsBuilder routingKey(ByteBuffer routingKey) {
284-
285-
super.routingKey(routingKey);
286-
return this;
287-
}
288-
289290
/**
290291
* Use light-weight transactions by applying {@code IF EXISTS}. Replaces a previous {@link #ifCondition(Filter)}.
291292
*
@@ -347,9 +348,9 @@ public DeleteOptionsBuilder ifCondition(Filter condition) {
347348
*/
348349
public DeleteOptions build() {
349350

350-
return new DeleteOptions(this.consistencyLevel, this.executionProfileResolver, this.keyspace, this.pageSize,
351-
this.serialConsistencyLevel, this.timeout, this.ttl, this.timestamp, this.tracing, this.ifExists,
352-
this.ifCondition, this.idempotent, this.routingKeyspace, this.routingKey);
351+
return new DeleteOptions(this.consistencyLevel, this.executionProfileResolver, this.idempotent, this.keyspace,
352+
this.pageSize, this.routingKeyspace, this.routingKey, this.serialConsistencyLevel, this.timeout, this.ttl,
353+
this.timestamp, this.tracing, this.ifExists, this.ifCondition);
353354
}
354355
}
355356
}

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

Lines changed: 30 additions & 28 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;
@@ -181,6 +182,13 @@ public InsertOptionsBuilder fetchSize(int fetchSize) {
181182
return (InsertOptionsBuilder) super.fetchSize(fetchSize);
182183
}
183184

185+
@Override
186+
public InsertOptionsBuilder idempotent(boolean idempotent) {
187+
188+
super.idempotent(idempotent);
189+
return this;
190+
}
191+
184192
@Override
185193
public InsertOptionsBuilder keyspace(CqlIdentifier keyspace) {
186194

@@ -209,6 +217,20 @@ public InsertOptionsBuilder readTimeout(long readTimeout, TimeUnit timeUnit) {
209217
return this;
210218
}
211219

220+
@Override
221+
public InsertOptionsBuilder routingKeyspace(CqlIdentifier routingKeyspace) {
222+
223+
super.routingKeyspace(routingKeyspace);
224+
return this;
225+
}
226+
227+
@Override
228+
public InsertOptionsBuilder routingKey(ByteBuffer routingKey) {
229+
230+
super.routingKey(routingKey);
231+
return this;
232+
}
233+
212234
@Override
213235
public InsertOptionsBuilder serialConsistencyLevel(ConsistencyLevel consistencyLevel) {
214236
super.serialConsistencyLevel(consistencyLevel);
@@ -264,27 +286,6 @@ public InsertOptionsBuilder timestamp(Instant timestamp) {
264286
return this;
265287
}
266288

267-
@Override
268-
public InsertOptionsBuilder idempotent(boolean idempotent) {
269-
270-
super.idempotent(idempotent);
271-
return this;
272-
}
273-
274-
@Override
275-
public InsertOptionsBuilder routingKeyspace(CqlIdentifier routingKeyspace) {
276-
277-
super.routingKeyspace(routingKeyspace);
278-
return this;
279-
}
280-
281-
@Override
282-
public InsertOptionsBuilder routingKey(ByteBuffer routingKey) {
283-
284-
super.routingKey(routingKey);
285-
return this;
286-
}
287-
288289
/**
289290
* Use light-weight transactions by applying {@code IF NOT EXISTS}.
290291
*
@@ -341,9 +342,10 @@ public InsertOptionsBuilder withInsertNulls(boolean insertNulls) {
341342
* @return a new {@link InsertOptions} with the configured values
342343
*/
343344
public InsertOptions build() {
344-
return new InsertOptions(this.consistencyLevel, this.executionProfileResolver, this.keyspace, this.pageSize,
345+
return new InsertOptions(this.consistencyLevel, this.executionProfileResolver, this.idempotent, this.keyspace,
346+
this.pageSize, this.routingKeyspace, this.routingKey,
345347
this.serialConsistencyLevel, this.timeout, this.ttl, this.timestamp, this.tracing, this.ifNotExists,
346-
this.insertNulls, this.idempotent, this.routingKeyspace, this.routingKey);
348+
this.insertNulls);
347349
}
348350
}
349351
}

0 commit comments

Comments
 (0)