@@ -59,7 +59,7 @@ public class Query {
59
59
60
60
/**
61
61
* Static factory method to create a {@link Query} using the provided {@link CriteriaDefinition}.
62
- *
62
+ *
63
63
* @param criteriaDefinition must not be {@literal null}.
64
64
* @return
65
65
* @since 1.6
@@ -72,7 +72,7 @@ public Query() {}
72
72
73
73
/**
74
74
* Creates a new {@link Query} using the given {@link CriteriaDefinition}.
75
- *
75
+ *
76
76
* @param criteriaDefinition must not be {@literal null}.
77
77
* @since 1.6
78
78
*/
@@ -82,7 +82,7 @@ public Query(CriteriaDefinition criteriaDefinition) {
82
82
83
83
/**
84
84
* Adds the given {@link CriteriaDefinition} to the current {@link Query}.
85
- *
85
+ *
86
86
* @param criteriaDefinition must not be {@literal null}.
87
87
* @return
88
88
* @since 1.6
@@ -96,8 +96,8 @@ public Query addCriteria(CriteriaDefinition criteriaDefinition) {
96
96
this .criteria .put (key , criteriaDefinition );
97
97
} else {
98
98
throw new InvalidMongoDbApiUsageException (
99
- "Due to limitations of the com.mongodb.BasicDBObject, " + " you can't add a second '" + key + " ' criteria. "
100
- + "Query already contains '" + serializeToJsonSafely (existing .getCriteriaObject ()) + "'." );
99
+ String . format ( "Due to limitations of the com.mongodb.BasicDBObject, you can't add a second '%s ' criteria. "
100
+ + "Query already contains '%s'" , key , serializeToJsonSafely (existing .getCriteriaObject ())) );
101
101
}
102
102
103
103
return this ;
@@ -112,7 +112,7 @@ public Field fields() {
112
112
113
113
/**
114
114
* Set number of documents to skip before returning results.
115
- *
115
+ *
116
116
* @param skip
117
117
* @return
118
118
*/
@@ -123,7 +123,7 @@ public Query skip(int skip) {
123
123
124
124
/**
125
125
* Limit the number of returned documents to {@code limit}.
126
- *
126
+ *
127
127
* @param limit
128
128
* @return
129
129
*/
@@ -134,7 +134,7 @@ public Query limit(int limit) {
134
134
135
135
/**
136
136
* Configures the query to use the given hint when being executed.
137
- *
137
+ *
138
138
* @param name must not be {@literal null} or empty.
139
139
* @return
140
140
*/
@@ -147,7 +147,7 @@ public Query withHint(String name) {
147
147
/**
148
148
* Sets the given pagination information on the {@link Query} instance. Will transparently set {@code skip} and
149
149
* {@code limit} as well as applying the {@link Sort} instance defined with the {@link Pageable}.
150
- *
150
+ *
151
151
* @param pageable
152
152
* @return
153
153
*/
@@ -165,7 +165,7 @@ public Query with(Pageable pageable) {
165
165
166
166
/**
167
167
* Adds a {@link Sort} to the {@link Query} instance.
168
- *
168
+ *
169
169
* @param sort
170
170
* @return
171
171
*/
@@ -200,7 +200,7 @@ public Set<Class<?>> getRestrictedTypes() {
200
200
201
201
/**
202
202
* Restricts the query to only return documents instances that are exactly of the given types.
203
- *
203
+ *
204
204
* @param type may not be {@literal null}
205
205
* @param additionalTypes may not be {@literal null}
206
206
* @return
@@ -254,7 +254,7 @@ public DBObject getSortObject() {
254
254
255
255
/**
256
256
* Get the number of documents to skip.
257
- *
257
+ *
258
258
* @return
259
259
*/
260
260
public int getSkip () {
@@ -263,7 +263,7 @@ public int getSkip() {
263
263
264
264
/**
265
265
* Get the maximum number of documents to be return.
266
- *
266
+ *
267
267
* @return
268
268
*/
269
269
public int getLimit () {
@@ -433,7 +433,7 @@ public boolean equals(Object obj) {
433
433
434
434
/**
435
435
* Tests whether the settings of the given {@link Query} are equal to this query.
436
- *
436
+ *
437
437
* @param that
438
438
* @return
439
439
*/
@@ -450,7 +450,7 @@ protected boolean querySettingsEquals(Query that) {
450
450
return criteriaEqual && fieldsEqual && sortEqual && hintEqual && skipEqual && limitEqual && metaEqual ;
451
451
}
452
452
453
- /*
453
+ /*
454
454
* (non-Javadoc)
455
455
* @see java.lang.Object#hashCode()
456
456
*/
@@ -472,7 +472,7 @@ public int hashCode() {
472
472
473
473
/**
474
474
* Returns whether the given key is the one used to hold the type restriction information.
475
- *
475
+ *
476
476
* @deprecated don't call this method as the restricted type handling will undergo some significant changes going
477
477
* forward.
478
478
* @param key
0 commit comments