Skip to content

Commit 2349593

Browse files
committed
Fixed some Javadoc errors in Filters, Projections, and Sorts.
1 parent 27de2e7 commit 2349593

File tree

3 files changed

+31
-32
lines changed

3 files changed

+31
-32
lines changed

driver-core/src/main/com/mongodb/client/model/Filters.java

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -55,77 +55,77 @@ private Filters() {
5555
*
5656
* @param fieldName the field name
5757
* @param value the value
58-
* @param <TField> the value type
58+
* @param <TItem> the value type
5959
* @return the filter
6060
* @mongodb.driver.manual reference/operator/query/eq $eq
6161
*/
62-
public static <TField> Bson eq(final String fieldName, final TField value) {
63-
return new SimpleEncodingFilter<TField>(fieldName, value);
62+
public static <TItem> Bson eq(final String fieldName, final TItem value) {
63+
return new SimpleEncodingFilter<TItem>(fieldName, value);
6464
}
6565

6666
/**
6767
* Creates a filter that matches all documents where the value of the field name does not equal the specified value.
6868
*
6969
* @param fieldName the field name
7070
* @param value the value
71-
* @param <TField> the value type
71+
* @param <TItem> the value type
7272
* @return the filter
7373
* @mongodb.driver.manual reference/operator/query/ne $ne
7474
*/
75-
public static <TField> Bson ne(final String fieldName, final TField value) {
76-
return new OperatorFilter<TField>("$ne", fieldName, value);
75+
public static <TItem> Bson ne(final String fieldName, final TItem value) {
76+
return new OperatorFilter<TItem>("$ne", fieldName, value);
7777
}
7878

7979
/**
8080
* Creates a filter that matches all documents where the value of the given field is greater than the specified value.
8181
*
8282
* @param fieldName the field name
8383
* @param value the value
84-
* @param <TField> the value type
84+
* @param <TItem> the value type
8585
* @return the filter
8686
* @mongodb.driver.manual reference/operator/query/gt $gt
8787
*/
88-
public static <TField> Bson gt(final String fieldName, final TField value) {
89-
return new OperatorFilter<TField>("$gt", fieldName, value);
88+
public static <TItem> Bson gt(final String fieldName, final TItem value) {
89+
return new OperatorFilter<TItem>("$gt", fieldName, value);
9090
}
9191

9292
/**
9393
* Creates a filter that matches all documents where the value of the given field is less than the specified value.
9494
*
9595
* @param fieldName the field name
9696
* @param value the value
97-
* @param <TField> the value type
97+
* @param <TItem> the value type
9898
* @return the filter
9999
* @mongodb.driver.manual reference/operator/query/lt $lt
100100
*/
101-
public static <TField> Bson lt(final String fieldName, final TField value) {
102-
return new OperatorFilter<TField>("$lt", fieldName, value);
101+
public static <TItem> Bson lt(final String fieldName, final TItem value) {
102+
return new OperatorFilter<TItem>("$lt", fieldName, value);
103103
}
104104

105105
/**
106106
* Creates a filter that matches all documents where the value of the given field is greater than or equal to the specified value.
107107
*
108108
* @param fieldName the field name
109109
* @param value the value
110-
* @param <TField> the value type
110+
* @param <TItem> the value type
111111
* @return the filter
112112
* @mongodb.driver.manual reference/operator/query/gte $gte
113113
*/
114-
public static <TField> Bson gte(final String fieldName, final TField value) {
115-
return new OperatorFilter<TField>("$gte", fieldName, value);
114+
public static <TItem> Bson gte(final String fieldName, final TItem value) {
115+
return new OperatorFilter<TItem>("$gte", fieldName, value);
116116
}
117117

118118
/**
119119
* Creates a filter that matches all documents where the value of the given field is less than or equal to the specified value.
120120
*
121121
* @param fieldName the field name
122122
* @param value the value
123-
* @param <TField> the value type
123+
* @param <TItem> the value type
124124
* @return the filter
125125
* @mongodb.driver.manual reference/operator/query/lte $lte
126126
*/
127-
public static <TField> Bson lte(final String fieldName, final TField value) {
128-
return new OperatorFilter<TField>("$lte", fieldName, value);
127+
public static <TItem> Bson lte(final String fieldName, final TItem value) {
128+
return new OperatorFilter<TItem>("$lte", fieldName, value);
129129
}
130130

131131
/**
@@ -465,12 +465,12 @@ public <TDocument> BsonDocument toBsonDocument(final Class<TDocument> documentCl
465465
}
466466
}
467467

468-
private static final class OperatorFilter<TField> implements Bson {
468+
private static final class OperatorFilter<TItem> implements Bson {
469469
private final String operatorName;
470470
private final String fieldName;
471-
private final TField value;
471+
private final TItem value;
472472

473-
OperatorFilter(final String operatorName, final String fieldName, final TField value) {
473+
OperatorFilter(final String operatorName, final String fieldName, final TItem value) {
474474
this.operatorName = notNull("operatorName", operatorName);
475475
this.fieldName = notNull("fieldName", fieldName);
476476
this.value = value;

driver-core/src/main/com/mongodb/client/model/Projections.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@
3131

3232
/**
3333
* A factory for projections. A convenient way to use this class is to statically import all of its methods, which allows usage like:
34-
* <p/>
34+
*
3535
* <blockquote><pre>
36-
* collection.find().projection(fields(include("x", "y"), excludeId())
36+
* collection.find().projection(fields(include("x", "y"), excludeId()))
3737
* </pre></blockquote>
3838
*
3939
* @mongodb.driver.manual tutorial/project-fields-from-query-results/#limit-fields-to-return-from-a-query Projection
@@ -99,7 +99,7 @@ public static Bson excludeId() {
9999
*
100100
* @param fieldName the field name whose value is the array
101101
* @return the projection
102-
* @mongodb.driver.manual reference/operator/projection/positional/#projection Project the first matchin element ($ operator)
102+
* @mongodb.driver.manual reference/operator/projection/positional/#projection Project the first matching element ($ operator)
103103
*/
104104
public static Bson elemMatch(final String fieldName) {
105105
return new BsonDocument(fieldName + ".$", new BsonInt32(1));
@@ -140,7 +140,7 @@ public static Bson metaTextScore(final String fieldName) {
140140
* @param fieldName the field name
141141
* @param limit the number of elements to project.
142142
* @return the projection
143-
* @mongodb.driver.manual
143+
* @mongodb.driver.manual reference/operator/projection/slice Slice
144144
*/
145145
public static Bson slice(final String fieldName, final int limit) {
146146
return new BsonDocument(fieldName, new BsonDocument("$slice", new BsonInt32(limit)));
@@ -153,7 +153,7 @@ public static Bson slice(final String fieldName, final int limit) {
153153
* @param skip the number of elements to skip before applying the limit
154154
* @param limit the number of elements to project
155155
* @return the projection
156-
* @mongodb.driver.manual
156+
* @mongodb.driver.manual reference/operator/projection/slice Slice
157157
*/
158158
public static Bson slice(final String fieldName, final int skip, final int limit) {
159159
return new BsonDocument(fieldName, new BsonDocument("$slice", new BsonArray(asList(new BsonInt32(skip), new BsonInt32(limit)))));
@@ -163,9 +163,8 @@ public static Bson slice(final String fieldName, final int skip, final int limit
163163
* Creates a projection that combines the list of projections into a single one. If there are duplicate keys, the last one takes
164164
* precedence.
165165
*
166-
* @param projections the list projections to combine
166+
* @param projections the list of projections to combine
167167
* @return the combined projection
168-
* @mongodb.driver.manual
169168
*/
170169
public static Bson fields(final Bson... projections) {
171170
return fields(asList(projections));
@@ -175,7 +174,7 @@ public static Bson fields(final Bson... projections) {
175174
* Creates a projection that combines the list of projections into a single one. If there are duplicate keys, the last one takes
176175
* precedence.
177176
*
178-
* @param projections the list projections to combine
177+
* @param projections the list of projections to combine
179178
* @return the combined projection
180179
* @mongodb.driver.manual
181180
*/

driver-core/src/main/com/mongodb/client/model/Sorts.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ public static Bson descending(final List<String> fieldNames) {
9494
*
9595
* @param fieldName the field name
9696
* @return the sort specification
97-
* @mongodb.driver.manual operator/projection/meta/#sort textScore
97+
* @mongodb.driver.manual reference/operator/projection/meta/#sort textScore
9898
*/
9999
public static Bson metaTextScore(final String fieldName) {
100100
return new BsonDocument(fieldName, new BsonDocument("$meta", new BsonString("textScore")));
@@ -104,7 +104,7 @@ public static Bson metaTextScore(final String fieldName) {
104104
* Combine multiple sort specifications. If any field names are repeated, the last one takes precendence.
105105
*
106106
* @param sorts the sort specifications
107-
* @return the combine sort specification
107+
* @return the combined sort specification
108108
*/
109109
public static Bson orderBy(final Bson... sorts) {
110110
return orderBy(asList(sorts));
@@ -114,7 +114,7 @@ public static Bson orderBy(final Bson... sorts) {
114114
* Combine multiple sort specifications. If any field names are repeated, the last one takes precendence.
115115
*
116116
* @param sorts the sort specifications
117-
* @return the combine sort specification
117+
* @return the combined sort specification
118118
*/
119119
public static Bson orderBy(final List<Bson> sorts) {
120120
notNull("sorts", sorts);

0 commit comments

Comments
 (0)