Skip to content

Commit 37d99c4

Browse files
christophstroblmp911de
authored andcommitted
DATAMONGO-2509 - Update Javadoc.
Original pull request: #853.
1 parent 288e04b commit 37d99c4

File tree

125 files changed

+1291
-1024
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+1291
-1024
lines changed

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/LazyLoadingException.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ public class LazyLoadingException extends UncategorizedDataAccessException {
2525
private static final long serialVersionUID = -7089224903873220037L;
2626

2727
/**
28-
* @param msg
29-
* @param cause
28+
* Constructor for LazyLoadingException.
29+
*
30+
* @param msg the detail message.
31+
* @param cause the exception thrown by underlying data access API.
3032
*/
3133
public LazyLoadingException(String msg, Throwable cause) {
3234
super(msg, cause);

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoDatabaseFactory.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public interface MongoDatabaseFactory extends CodecRegistryProvider, MongoSessio
4545
/**
4646
* Obtain a {@link MongoDatabase} instance to access the database with the given name.
4747
*
48-
* @param dbName
48+
* @param dbName must not be {@literal null}.
4949
* @return never {@literal null}.
5050
* @throws DataAccessException
5151
*/

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/MongoDbFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public interface MongoDbFactory extends MongoDatabaseFactory {
3333
/**
3434
* Creates a default {@link MongoDatabase} instance.
3535
*
36-
* @return
36+
* @return never {@literal null}.
3737
* @throws DataAccessException
3838
* @deprecated since 3.0. Use {@link #getMongoDatabase()} instead.
3939
*/
@@ -46,7 +46,7 @@ default MongoDatabase getDb() throws DataAccessException {
4646
* Obtain a {@link MongoDatabase} instance to access the database with the given name.
4747
*
4848
* @param dbName must not be {@literal null} or empty.
49-
* @return
49+
* @return never {@literal null}.
5050
* @throws DataAccessException
5151
* @deprecated since 3.0. Use {@link #getMongoDatabase(String)} instead.
5252
*/

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/ReactiveMongoDatabaseFactory.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public interface ReactiveMongoDatabaseFactory extends CodecRegistryProvider {
3939
/**
4040
* Creates a default {@link MongoDatabase} instance.
4141
*
42-
* @return
42+
* @return never {@literal null}.
4343
* @throws DataAccessException
4444
*/
4545
Mono<MongoDatabase> getMongoDatabase() throws DataAccessException;
@@ -48,7 +48,7 @@ public interface ReactiveMongoDatabaseFactory extends CodecRegistryProvider {
4848
* Obtain a {@link MongoDatabase} instance to access the database with the given name.
4949
*
5050
* @param dbName must not be {@literal null} or empty.
51-
* @return
51+
* @return never {@literal null}.
5252
* @throws DataAccessException
5353
*/
5454
Mono<MongoDatabase> getMongoDatabase(String dbName) throws DataAccessException;

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/EnableMongoAuditing.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,29 +42,29 @@
4242
/**
4343
* Configures the {@link AuditorAware} bean to be used to lookup the current principal.
4444
*
45-
* @return
45+
* @return empty {@link String} by default.
4646
*/
4747
String auditorAwareRef() default "";
4848

4949
/**
5050
* Configures whether the creation and modification dates are set. Defaults to {@literal true}.
5151
*
52-
* @return
52+
* @return {@literal true} by default.
5353
*/
5454
boolean setDates() default true;
5555

5656
/**
5757
* Configures whether the entity shall be marked as modified on creation. Defaults to {@literal true}.
5858
*
59-
* @return
59+
* @return {@literal true} by default.
6060
*/
6161
boolean modifyOnCreate() default true;
6262

6363
/**
6464
* Configures a {@link DateTimeProvider} bean name that allows customizing the {@link org.joda.time.DateTime} to be
6565
* used for setting creation and modification dates.
6666
*
67-
* @return
67+
* @return empty {@link String} by default.
6868
*/
6969
String dateTimeProviderRef() default "";
7070
}

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/config/MongoConfigurationSupport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public MongoMappingContext mongoMappingContext(MongoCustomConversions customConv
9595
/**
9696
* Register custom {@link Converter}s in a {@link CustomConversions} object if required. These
9797
* {@link CustomConversions} will be registered with the
98-
* {@link org.springframework.data.mongodb.core.convert.MappingMongoConverter} and {@link #mongoMappingContext()}.
98+
* {@link org.springframework.data.mongodb.core.convert.MappingMongoConverter} and {@link MongoMappingContext}.
9999
* Returns an empty {@link MongoCustomConversions} instance by default.
100100
* <p>
101101
* <strong>NOTE:</strong> Use {@link #configureConverters(MongoConverterConfigurationAdapter)} to configure MongoDB

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/BulkOperations.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@ enum BulkMode {
9494
* Add a list of updates to the bulk operation. For each update request, all matching documents are updated.
9595
*
9696
* @param updates Update operations to perform.
97-
* @return The bulk operation.
9897
* @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}.
9998
*/
10099
BulkOperations updateMulti(List<Pair<Query, Update>> updates);
@@ -105,7 +104,6 @@ enum BulkMode {
105104
*
106105
* @param query Update criteria.
107106
* @param update Update operation to perform.
108-
* @return The bulk operation.
109107
* @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}.
110108
*/
111109
BulkOperations upsert(Query query, Update update);
@@ -115,7 +113,6 @@ enum BulkMode {
115113
* else an insert.
116114
*
117115
* @param updates Updates/insert operations to perform.
118-
* @return The bulk operation.
119116
* @return the current {@link BulkOperations} instance with the update added, will never be {@literal null}.
120117
*/
121118
BulkOperations upsert(List<Pair<Query, Update>> updates);

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/CollectionCallback.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* @author Grame Rocher
3030
* @author Oliver Gierke
3131
* @author John Brisbin
32-
* @auhtor Christoph Strobl
32+
* @author Christoph Strobl
3333
* @since 1.0
3434
*/
3535
public interface CollectionCallback<T> {

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/CollectionOptions.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static CollectionOptions empty() {
9595

9696
/**
9797
* Create new {@link CollectionOptions} with already given settings and capped set to {@literal true}. <br />
98-
* <strong>NOTE</strong> Using capped collections requires defining {@link #size(int)}.
98+
* <strong>NOTE</strong> Using capped collections requires defining {@link #size(long)}.
9999
*
100100
* @return new {@link CollectionOptions}.
101101
* @since 2.0

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/CursorPreparer.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,18 @@ public interface CursorPreparer extends ReadPreferenceAware {
4343
/**
4444
* Prepare the given cursor (apply limits, skips and so on). Returns the prepared cursor.
4545
*
46-
* @param cursor
46+
* @param iterable must not be {@literal null}.
47+
* @return never {@literal null}.
4748
*/
48-
FindIterable<Document> prepare(FindIterable<Document> cursor);
49+
FindIterable<Document> prepare(FindIterable<Document> iterable);
4950

5051
/**
5152
* Apply query specific settings to {@link MongoCollection} and initate a find operation returning a
5253
* {@link FindIterable} via the given {@link Function find} function.
5354
*
5455
* @param collection must not be {@literal null}.
5556
* @param find must not be {@literal null}.
56-
* @return
57+
* @return never {@literal null}.
5758
* @throws IllegalArgumentException if one of the required arguments is {@literal null}.
5859
* @since 2.2
5960
*/

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/DocumentCallbackHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
/**
2424
* An interface used by {@link MongoTemplate} for processing documents returned from a MongoDB query on a per-document
2525
* basis. Implementations of this interface perform the actual work of prcoessing each document but don't need to worry
26-
* about exception handling. {@MongoException}s will be caught and translated by the calling MongoTemplate An
26+
* about exception handling. {@link MongoException}s will be caught and translated by the calling MongoTemplate An
2727
* DocumentCallbackHandler is typically stateful: It keeps the result state within the object, to be available later for
2828
* later inspection.
2929
*

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/EntityOperations.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class EntityOperations {
6666
* Creates a new {@link Entity} for the given bean.
6767
*
6868
* @param entity must not be {@literal null}.
69-
* @return
69+
* @return new instance of {@link Entity}.
7070
*/
7171
@SuppressWarnings({ "unchecked", "rawtypes" })
7272
public <T> Entity<T> forEntity(T entity) {
@@ -89,7 +89,7 @@ public <T> Entity<T> forEntity(T entity) {
8989
*
9090
* @param entity must not be {@literal null}.
9191
* @param conversionService must not be {@literal null}.
92-
* @return
92+
* @return new instance of {@link AdaptibleEntity}.
9393
*/
9494
@SuppressWarnings({ "unchecked", "rawtypes" })
9595
public <T> AdaptibleEntity<T> forEntity(T entity, ConversionService conversionService) {
@@ -108,6 +108,10 @@ public <T> AdaptibleEntity<T> forEntity(T entity, ConversionService conversionSe
108108
return AdaptibleMappedEntity.of(entity, context, conversionService);
109109
}
110110

111+
/**
112+
* @param entityClass should not be null.
113+
* @return the {@link MongoPersistentEntity#getCollection() collection name}.
114+
*/
111115
public String determineCollectionName(@Nullable Class<?> entityClass) {
112116

113117
if (entityClass == null) {
@@ -138,7 +142,7 @@ public Query getByIdInQuery(Collection<?> entities) {
138142
* {@code _id} if no identifier property can be found.
139143
*
140144
* @param type must not be {@literal null}.
141-
* @return
145+
* @return never {@literal null}.
142146
*/
143147
public String getIdPropertyName(Class<?> type) {
144148

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableAggregationOperation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,9 @@ interface TerminatingAggregation<T> {
8888

8989
/**
9090
* Apply pipeline operations as specified and stream all matching elements. <br />
91-
* Returns a {@link CloseableIterator} that wraps the a Mongo DB {@link com.mongodb.Cursor}
91+
* Returns a {@link CloseableIterator} that wraps the a Mongo DB {@link com.mongodb.client.FindIterable}
9292
*
93-
* @return a {@link CloseableIterator} that wraps the a Mongo DB {@link com.mongodb.Cursor} that needs to be closed.
93+
* @return a {@link CloseableIterator} that wraps the a Mongo DB {@link com.mongodb.client.FindIterable} that needs to be closed.
9494
* Never {@literal null}.
9595
*/
9696
CloseableIterator<T> stream();

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableFindOperation.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ default Optional<T> first() {
118118
/**
119119
* Stream all matching elements.
120120
*
121-
* @return a {@link Stream} that wraps the a Mongo DB {@link com.mongodb.Cursor} that needs to be closed. Never
121+
* @return a {@link Stream} that wraps the a Mongo DB {@link com.mongodb.client.FindIterable} that needs to be closed. Never
122122
* {@literal null}.
123123
*/
124124
Stream<T> stream();

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ExecutableFindOperationSupport.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,9 +257,9 @@ static class DelegatingQueryCursorPreparer implements CursorPreparer {
257257
* @see org.springframework.data.mongodb.core.CursorPreparer#prepare(com.mongodb.clientFindIterable)
258258
*/
259259
@Override
260-
public FindIterable<Document> prepare(FindIterable<Document> cursor) {
260+
public FindIterable<Document> prepare(FindIterable<Document> iterable) {
261261

262-
FindIterable<Document> target = delegate != null ? delegate.prepare(cursor) : cursor;
262+
FindIterable<Document> target = delegate != null ? delegate.prepare(iterable) : iterable;
263263
return limit.map(target::limit).orElse(target);
264264
}
265265

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindAndModifyOptions.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public static FindAndModifyOptions none() {
7878
}
7979

8080
/**
81-
* Create new {@link FindAndModifyOptions} based on option of given {@litearl source}.
81+
* Create new {@link FindAndModifyOptions} based on option of given {@literal source}.
8282
*
8383
* @param source can be {@literal null}.
8484
* @return new instance of {@link FindAndModifyOptions}.
@@ -117,8 +117,8 @@ public FindAndModifyOptions remove(boolean remove) {
117117
/**
118118
* Define the {@link Collation} specifying language-specific rules for string comparison.
119119
*
120-
* @param collation
121-
* @return
120+
* @param collation can be {@literal null}.
121+
* @return this.
122122
* @since 2.0
123123
*/
124124
public FindAndModifyOptions collation(@Nullable Collation collation) {
@@ -142,7 +142,7 @@ public boolean isRemove() {
142142
/**
143143
* Get the {@link Collation} specifying language-specific rules for string comparison.
144144
*
145-
* @return
145+
* @return never {@literal null}.
146146
* @since 2.0
147147
*/
148148
public Optional<Collation> getCollation() {

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindAndReplaceOptions.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ public FindAndReplaceOptions upsert() {
116116
/**
117117
* Get the bit indicating to return the replacement document.
118118
*
119-
* @return
119+
* @return {@literal true} if set.
120120
*/
121121
public boolean isReturnNew() {
122122
return returnNew;
@@ -125,7 +125,7 @@ public boolean isReturnNew() {
125125
/**
126126
* Get the bit indicating if to create a new document if not exists.
127127
*
128-
* @return
128+
* @return {@literal true} if set.
129129
*/
130130
public boolean isUpsert() {
131131
return upsert;

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/FindPublisherPreparer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public interface FindPublisherPreparer extends ReadPreferenceAware {
5454
*
5555
* @param collection must not be {@literal null}.
5656
* @param find must not be {@literal null}.
57-
* @return
57+
* @return never {@literal null}.
5858
* @throws IllegalArgumentException if one of the required arguments is {@literal null}.
5959
* @since 2.2
6060
*/

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/GeoCommandStatistics.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ private GeoCommandStatistics(Document source) {
4747
* Creates a new {@link GeoCommandStatistics} from the given command result extracting the statistics.
4848
*
4949
* @param commandResult must not be {@literal null}.
50-
* @return
50+
* @return never {@literal null}.
5151
*/
5252
public static GeoCommandStatistics from(Document commandResult) {
5353

@@ -61,7 +61,7 @@ public static GeoCommandStatistics from(Document commandResult) {
6161
* Returns the average distance reported by the command result. Mitigating a removal of the field in case the command
6262
* didn't return any result introduced in MongoDB 3.2 RC1.
6363
*
64-
* @return
64+
* @return never {@literal null}, uses {@link Double#NaN} if {@literal avgDistance} does not exist.
6565
* @see <a href="https://jira.mongodb.org/browse/SERVER-21024">MongoDB Jira SERVER-21024</a>
6666
*/
6767
public double getAverageDistance() {

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoOperations.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ public interface MongoOperations extends FluentMongoOperations {
7979
* The collection name used for the specified class by this template.
8080
*
8181
* @param entityClass must not be {@literal null}.
82-
* @return
82+
* @return never {@literal null}.
8383
*/
8484
String getCollectionName(Class<?> entityClass);
8585

@@ -363,7 +363,7 @@ public <T> T execute(SessionCallback<T> action, Consumer<ClientSession> onComple
363363
/**
364364
* Returns the {@link ScriptOperations} that can be performed on {@link com.mongodb.client.MongoDatabase} level.
365365
*
366-
* @return
366+
* @return never {@literal null}.
367367
* @since 1.7
368368
* @deprecated since 2.2. The {@code eval} command has been removed without replacement in MongoDB Server 4.2.0.
369369
*/
@@ -1557,7 +1557,7 @@ <S, T> T findAndReplace(Query query, S replacement, FindAndReplaceOptions option
15571557
/**
15581558
* Returns the underlying {@link MongoConverter}.
15591559
*
1560-
* @return
1560+
* @return never {@literal null}.
15611561
*/
15621562
MongoConverter getConverter();
15631563
}

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/MongoTemplate.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3199,9 +3199,9 @@ public QueryCursorPreparer(Query query, @Nullable Class<?> type) {
31993199
* (non-Javadoc)
32003200
* @see org.springframework.data.mongodb.core.CursorPreparer#prepare(com.mongodb.DBCursor)
32013201
*/
3202-
public FindIterable<Document> prepare(FindIterable<Document> cursor) {
3202+
public FindIterable<Document> prepare(FindIterable<Document> iterable) {
32033203

3204-
FindIterable<Document> cursorToUse = cursor;
3204+
FindIterable<Document> cursorToUse = iterable;
32053205

32063206
operations.forType(type).getCollation(query) //
32073207
.map(Collation::toMongoCollation) //

spring-data-mongodb/src/main/java/org/springframework/data/mongodb/core/ReactiveMongoOperations.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1239,7 +1239,7 @@ <S, T> Mono<T> findAndReplace(Query query, S replacement, FindAndReplaceOptions
12391239
* domain type information. Use {@link #updateFirst(Query, UpdateDefinition, Class, String)} to get full type specific
12401240
* support. <br />
12411241
* <strong>NOTE:</strong> {@link Query#getSortObject() sorting} is not supported by {@code db.collection.updateOne}.
1242-
* Use {@link #findAndModify(Query, Update, Class, String)} instead.
1242+
* Use {@link #findAndModify(Query, UpdateDefinition, Class, String)} instead.
12431243
*
12441244
* @param query the query document that specifies the criteria used to select a record to be updated. Must not be
12451245
* {@literal null}.
@@ -1572,15 +1572,15 @@ <T> Flux<T> mapReduce(Query filterQuery, Class<?> domainType, String inputCollec
15721572
/**
15731573
* Returns the underlying {@link MongoConverter}.
15741574
*
1575-
* @return
1575+
* @return never {@literal null}.
15761576
*/
15771577
MongoConverter getConverter();
15781578

15791579
/**
15801580
* The collection name used for the specified class by this template.
15811581
*
15821582
* @param entityClass must not be {@literal null}.
1583-
* @return
1583+
* @return never {@literal null}.
15841584
* @since 2.1
15851585
*/
15861586
String getCollectionName(Class<?> entityClass);

0 commit comments

Comments
 (0)