Skip to content

Commit 7db8e64

Browse files
committed
#8 - Polishing.
Formatting, JavaDoc, issue comments on `@Test` annotations. Removed some dead code. Original pull request: #33.
1 parent 5a5310a commit 7db8e64

File tree

7 files changed

+139
-142
lines changed

7 files changed

+139
-142
lines changed

src/main/java/org/springframework/data/r2dbc/function/DatabaseClient.java

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,9 @@ public interface DatabaseClient {
6464
// Static, factory methods
6565

6666
/**
67-
* A variant of {@link #create()} that accepts a {@link io.r2dbc.spi.ConnectionFactory}
67+
* Creates a {@code DatabaseClient} that will use the provided {@link io.r2dbc.spi.ConnectionFactory}.
68+
* @param factory The {@code ConnectionFactory} to use for obtaining connections.
69+
* @return a new {@code DatabaseClient}. Guaranteed to be not {@code null}.
6870
*/
6971
static DatabaseClient create(ConnectionFactory factory) {
7072
return new DefaultDatabaseClientBuilder().connectionFactory(factory).build();
@@ -161,7 +163,7 @@ interface GenericExecuteSpec extends BindSpec<GenericExecuteSpec> {
161163
*
162164
* @param mappingFunction must not be {@literal null}.
163165
* @param <R> result type.
164-
* @return
166+
* @return a {@link FetchSpec} for configuration what to fetch. Guaranteed to be not {@code null}.
165167
*/
166168
<R> FetchSpec<R> map(BiFunction<Row, RowMetadata, R> mappingFunction);
167169

@@ -197,7 +199,7 @@ interface TypedExecuteSpec<T> extends BindSpec<TypedExecuteSpec<T>> {
197199
*
198200
* @param mappingFunction must not be {@literal null}.
199201
* @param <R> result type.
200-
* @return
202+
* @return a {@link FetchSpec} for configuration what to fetch. Guaranteed to be not {@code null}.
201203
*/
202204
<R> FetchSpec<R> map(BiFunction<Row, RowMetadata, R> mappingFunction);
203205

@@ -223,15 +225,15 @@ interface SelectFromSpec {
223225
* Specify the source {@literal table} to select from.
224226
*
225227
* @param table must not be {@literal null} or empty.
226-
* @return
228+
* @return a {@link GenericSelectSpec} for further configuration of the select. Guaranteed to be not {@code null}.
227229
*/
228230
GenericSelectSpec from(String table);
229231

230232
/**
231233
* Specify the source table to select from to using the {@link Class entity class}.
232234
*
233235
* @param table must not be {@literal null}.
234-
* @return
236+
* @return a {@link TypedSelectSpec} for further configuration of the select. Guaranteed to be not {@code null}.
235237
*/
236238
<T> TypedSelectSpec<T> from(Class<T> table);
237239
}
@@ -245,15 +247,15 @@ interface InsertIntoSpec {
245247
* Specify the target {@literal table} to insert into.
246248
*
247249
* @param table must not be {@literal null} or empty.
248-
* @return
250+
* @return a {@link GenericInsertSpec} for further configuration of the insert. Guaranteed to be not {@code null}.
249251
*/
250252
GenericInsertSpec<Map<String, Object>> into(String table);
251253

252254
/**
253255
* Specify the target table to insert to using the {@link Class entity class}.
254256
*
255257
* @param table must not be {@literal null}.
256-
* @return
258+
* @return a {@link TypedInsertSpec} for further configuration of the insert. Guaranteed to be not {@code null}.
257259
*/
258260
<T> TypedInsertSpec<T> into(Class<T> table);
259261
}
@@ -277,7 +279,7 @@ interface GenericSelectSpec extends SelectSpec<GenericSelectSpec> {
277279
*
278280
* @param mappingFunction must not be {@literal null}.
279281
* @param <R> result type.
280-
* @return
282+
* @return a {@link FetchSpec} for configuration what to fetch. Guaranteed to be not {@code null}.
281283
*/
282284
<R> FetchSpec<R> map(BiFunction<Row, RowMetadata, R> mappingFunction);
283285

@@ -306,7 +308,7 @@ interface TypedSelectSpec<T> extends SelectSpec<TypedSelectSpec<T>> {
306308
*
307309
* @param mappingFunction must not be {@literal null}.
308310
* @param <R> result type.
309-
* @return
311+
* @return a {@link FetchSpec} for configuration what to fetch. Guaranteed to be not {@code null}.
310312
*/
311313
<R> FetchSpec<R> map(BiFunction<Row, RowMetadata, R> mappingFunction);
312314

@@ -375,25 +377,25 @@ interface TypedInsertSpec<T> {
375377
/**
376378
* Insert the given {@code objectToInsert}.
377379
*
378-
* @param objectToInsert
379-
* @return
380+
* @param objectToInsert the object of which the attributes will provide the values for the insert. Must not be {@code null}.
381+
* @return a {@link InsertSpec} for further configuration of the insert. Guaranteed to be not {@code null}.
380382
*/
381383
InsertSpec<Map<String, Object>> using(T objectToInsert);
382384

383385
/**
384386
* Use the given {@code tableName} as insert target.
385387
*
386388
* @param tableName must not be {@literal null} or empty.
387-
* @return
389+
* @return a {@link TypedInsertSpec} for further configuration of the insert. Guaranteed to be not {@code null}.
388390
*/
389391
TypedInsertSpec<T> table(String tableName);
390392

391393
/**
392394
* Insert the given {@link Publisher} to insert one or more objects. Inserts only a single object when calling
393395
* {@link FetchSpec#one()} or {@link FetchSpec#first()}.
394396
*
395-
* @param objectToInsert
396-
* @return
397+
* @param objectToInsert a publisher providing the objects of which the attributes will provide the values for the insert. Must not be {@code null}.
398+
* @return a {@link InsertSpec} for further configuration of the insert. Guaranteed to be not {@code null}.
397399
* @see InsertSpec#fetch()
398400
*/
399401
InsertSpec<Map<String, Object>> using(Publisher<T> objectToInsert);
@@ -411,7 +413,7 @@ interface InsertSpec<T> {
411413
*
412414
* @param mappingFunction must not be {@literal null}.
413415
* @param <R> result type.
414-
* @return
416+
* @return a {@link FetchSpec} for configuration what to fetch. Guaranteed to be not {@code null}.
415417
*/
416418
<R> FetchSpec<R> map(BiFunction<Row, RowMetadata, R> mappingFunction);
417419

@@ -436,15 +438,15 @@ interface BindSpec<S extends BindSpec<S>> {
436438
/**
437439
* Bind a non-{@literal null} value to a parameter identified by its {@code index}.
438440
*
439-
* @param index
440-
* @param value must not be {@literal null}.
441+
* @param index zero based index to bind the parameter to.
442+
* @param value to bind. Must not be {@literal null}.
441443
*/
442444
S bind(int index, Object value);
443445

444446
/**
445447
* Bind a {@literal null} value to a parameter identified by its {@code index}.
446448
*
447-
* @param index
449+
* @param index zero based index to bind the parameter to.
448450
* @param type must not be {@literal null}.
449451
*/
450452
S bindNull(int index, Class<?> type);

0 commit comments

Comments
 (0)