Skip to content

Commit

Permalink
Polishing.
Browse files Browse the repository at this point in the history
Use Method reference for in-/exclusion update javadoc since tags.

Original Pull Request: #4668
  • Loading branch information
christophstrobl committed Sep 11, 2024
1 parent d2a9744 commit 541c43b
Showing 1 changed file with 4 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,6 @@ public Field projectAs(MongoExpression expression, String field) {
* @since 3.1
*/
public Field include(String... fields) {

return include(Arrays.asList(fields));
}

Expand All @@ -134,15 +133,13 @@ public Field include(String... fields) {
*
* @param fields the document field names to be included.
* @return {@code this} field projection instance.
* @since 4.4
*/
public Field include(Collection<String> fields) {

Assert.notNull(fields, "Keys must not be null");

for (String key : fields) {
criteria.put(key, 1);
}

fields.forEach(this::include);
return this;
}

Expand All @@ -169,7 +166,6 @@ public Field exclude(String field) {
* @since 3.1
*/
public Field exclude(String... fields) {

return exclude(Arrays.asList(fields));
}

Expand All @@ -178,15 +174,13 @@ public Field exclude(String... fields) {
*
* @param fields the document field names to be excluded.
* @return {@code this} field projection instance.
* @since 4.4
*/
public Field exclude(Collection<String> fields) {

Assert.notNull(fields, "Keys must not be null");

for (String key : fields) {
criteria.put(key, 0);
}

fields.forEach(this::exclude);
return this;
}

Expand Down

0 comments on commit 541c43b

Please sign in to comment.