Skip to content

Commit 6bbb231

Browse files
committed
Rename methods (automated) (#1073)
JAVA-3879
1 parent 441bc53 commit 6bbb231

11 files changed

+78
-78
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ public interface MqlArray<T extends MqlValue> extends MqlValue {
162162
* @param mapper the mapper function.
163163
* @return the resulting value.
164164
*/
165-
MqlString join(Function<? super T, MqlString> mapper);
165+
MqlString joinStrings(Function<? super T, MqlString> mapper);
166166

167167
/**
168168
* The {@linkplain #concat(MqlArray) array-concatenation}
@@ -179,7 +179,7 @@ public interface MqlArray<T extends MqlValue> extends MqlValue {
179179
* @return the resulting value.
180180
* @param <R> the type of the elements of the array.
181181
*/
182-
<R extends MqlValue> MqlArray<R> concat(Function<? super T, ? extends MqlArray<? extends R>> mapper);
182+
<R extends MqlValue> MqlArray<R> concatArrays(Function<? super T, ? extends MqlArray<? extends R>> mapper);
183183

184184
/**
185185
* The {@linkplain #union(MqlArray) set-union}
@@ -196,7 +196,7 @@ public interface MqlArray<T extends MqlValue> extends MqlValue {
196196
* @return the resulting value.
197197
* @param <R> the type of the elements of the array.
198198
*/
199-
<R extends MqlValue> MqlArray<R> union(Function<? super T, ? extends MqlArray<? extends R>> mapper);
199+
<R extends MqlValue> MqlArray<R> unionArrays(Function<? super T, ? extends MqlArray<? extends R>> mapper);
200200

201201
/**
202202
* The {@linkplain MqlMap map} value corresponding to the

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

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public interface MqlDocument extends MqlValue {
5151
* @param fieldName the name of the field.
5252
* @return the resulting value.
5353
*/
54-
MqlBoolean has(String fieldName);
54+
MqlBoolean hasField(String fieldName);
5555

5656
/**
5757
* Returns a document with the same fields as {@code this} document, but
@@ -87,7 +87,7 @@ public interface MqlDocument extends MqlValue {
8787
* with the provided {@code fieldName}.
8888
*
8989
* <p>Warning: Use of this method is an assertion that the document
90-
* {@linkplain #has(String) has} the named field.
90+
* {@linkplain #hasField(String) has} the named field.
9191
*
9292
* @mongodb.server.release 5.0
9393
* @param fieldName the name of the field.
@@ -103,7 +103,7 @@ public interface MqlDocument extends MqlValue {
103103
* <p>Warning: The type and presence of the resulting value is not
104104
* enforced by the API. The use of this method is an
105105
* unchecked assertion that the document
106-
* {@linkplain #has(String) has} the named field and
106+
* {@linkplain #hasField(String) has} the named field and
107107
* the field value is of the specified type.
108108
*
109109
* @mongodb.server.release 5.0
@@ -117,7 +117,7 @@ public interface MqlDocument extends MqlValue {
117117
* Returns the {@linkplain MqlBoolean boolean} value of the field
118118
* with the provided {@code fieldName},
119119
* or the {@code other} value if the field is not a boolean
120-
* or if the document {@linkplain #has} no such field.
120+
* or if the document {@linkplain #hasField} no such field.
121121
*
122122
* @mongodb.server.release 5.0
123123
* @param fieldName the name of the field.
@@ -130,7 +130,7 @@ public interface MqlDocument extends MqlValue {
130130
* Returns the {@linkplain MqlBoolean boolean} value of the field
131131
* with the provided {@code fieldName},
132132
* or the {@code other} value if the field is not a boolean
133-
* or if the document {@linkplain #has} no such field.
133+
* or if the document {@linkplain #hasField} no such field.
134134
*
135135
* @mongodb.server.release 5.0
136136
* @param fieldName the name of the field.
@@ -149,7 +149,7 @@ default MqlBoolean getBoolean(final String fieldName, final boolean other) {
149149
* <p>Warning: The type and presence of the resulting value is not
150150
* enforced by the API. The use of this method is an
151151
* unchecked assertion that the document
152-
* {@linkplain #has(String) has} the named field and
152+
* {@linkplain #hasField(String) has} the named field and
153153
* the field value is of the specified type.
154154
*
155155
* @mongodb.server.release 5.0
@@ -163,7 +163,7 @@ default MqlBoolean getBoolean(final String fieldName, final boolean other) {
163163
* Returns the {@linkplain MqlNumber number} value of the field
164164
* with the provided {@code fieldName},
165165
* or the {@code other} value if the field is not a number
166-
* or if the document {@linkplain #has} no such field.
166+
* or if the document {@linkplain #hasField} no such field.
167167
*
168168
* @mongodb.server.release 5.0
169169
* @param fieldName the name of the field.
@@ -176,7 +176,7 @@ default MqlBoolean getBoolean(final String fieldName, final boolean other) {
176176
* Returns the {@linkplain MqlNumber number} value of the field
177177
* with the provided {@code fieldName},
178178
* or the {@code other} value if the field is not a number
179-
* or if the document {@linkplain #has} no such field.
179+
* or if the document {@linkplain #hasField} no such field.
180180
*
181181
* @mongodb.server.release 5.0
182182
* @param fieldName the name of the field.
@@ -196,7 +196,7 @@ default MqlNumber getNumber(final String fieldName, final Number other) {
196196
* <p>Warning: The type and presence of the resulting value is not
197197
* enforced by the API. The use of this method is an
198198
* unchecked assertion that the document
199-
* {@linkplain #has(String) has} the named field and
199+
* {@linkplain #hasField(String) has} the named field and
200200
* the field value is of the specified type.
201201
*
202202
* @mongodb.server.release 5.0
@@ -210,7 +210,7 @@ default MqlNumber getNumber(final String fieldName, final Number other) {
210210
* Returns the {@linkplain MqlInteger integer} value of the field
211211
* with the provided {@code fieldName},
212212
* or the {@code other} value if the field is not an integer
213-
* or if the document {@linkplain #has} no such field.
213+
* or if the document {@linkplain #hasField} no such field.
214214
*
215215
* @mongodb.server.release 5.0
216216
* @param fieldName the name of the field.
@@ -223,7 +223,7 @@ default MqlNumber getNumber(final String fieldName, final Number other) {
223223
* Returns the {@linkplain MqlInteger integer} value of the field
224224
* with the provided {@code fieldName},
225225
* or the {@code other} value if the field is not an integer
226-
* or if the document {@linkplain #has} no such field.
226+
* or if the document {@linkplain #hasField} no such field.
227227
*
228228
* @mongodb.server.release 5.0
229229
* @param fieldName the name of the field.
@@ -239,7 +239,7 @@ default MqlInteger getInteger(final String fieldName, final int other) {
239239
* Returns the {@linkplain MqlInteger integer} value of the field
240240
* with the provided {@code fieldName},
241241
* or the {@code other} value if the field is not an integer
242-
* or if the document {@linkplain #has} no such field.
242+
* or if the document {@linkplain #hasField} no such field.
243243
*
244244
* @mongodb.server.release 5.0
245245
* @param fieldName the name of the field.
@@ -258,7 +258,7 @@ default MqlInteger getInteger(final String fieldName, final long other) {
258258
* <p>Warning: The type and presence of the resulting value is not
259259
* enforced by the API. The use of this method is an
260260
* unchecked assertion that the document
261-
* {@linkplain #has(String) has} the named field and
261+
* {@linkplain #hasField(String) has} the named field and
262262
* the field value is of the specified type.
263263
*
264264
* @mongodb.server.release 5.0
@@ -272,7 +272,7 @@ default MqlInteger getInteger(final String fieldName, final long other) {
272272
* Returns the {@linkplain MqlString string} value of the field
273273
* with the provided {@code fieldName},
274274
* or the {@code other} value if the field is not a string
275-
* or if the document {@linkplain #has} no such field.
275+
* or if the document {@linkplain #hasField} no such field.
276276
*
277277
* @mongodb.server.release 5.0
278278
* @param fieldName the name of the field.
@@ -285,7 +285,7 @@ default MqlInteger getInteger(final String fieldName, final long other) {
285285
* Returns the {@linkplain MqlString string} value of the field
286286
* with the provided {@code fieldName},
287287
* or the {@code other} value if the field is not a string
288-
* or if the document {@linkplain #has} no such field.
288+
* or if the document {@linkplain #hasField} no such field.
289289
*
290290
* @mongodb.server.release 5.0
291291
* @param fieldName the name of the field.
@@ -305,7 +305,7 @@ default MqlString getString(final String fieldName, final String other) {
305305
* <p>Warning: The type and presence of the resulting value is not
306306
* enforced by the API. The use of this method is an
307307
* unchecked assertion that the document
308-
* {@linkplain #has(String) has} the named field and
308+
* {@linkplain #hasField(String) has} the named field and
309309
* the field value is of the specified type.
310310
*
311311
* @mongodb.server.release 5.0
@@ -319,7 +319,7 @@ default MqlString getString(final String fieldName, final String other) {
319319
* Returns the {@linkplain MqlDate date} value of the field
320320
* with the provided {@code fieldName},
321321
* or the {@code other} value if the field is not a date
322-
* or if the document {@linkplain #has} no such field.
322+
* or if the document {@linkplain #hasField} no such field.
323323
*
324324
* @mongodb.server.release 5.0
325325
* @param fieldName the name of the field.
@@ -332,7 +332,7 @@ default MqlString getString(final String fieldName, final String other) {
332332
* Returns the {@linkplain MqlDate date} value of the field
333333
* with the provided {@code fieldName},
334334
* or the {@code other} value if the field is not a date
335-
* or if the document {@linkplain #has} no such field.
335+
* or if the document {@linkplain #hasField} no such field.
336336
*
337337
* @mongodb.server.release 5.0
338338
* @param fieldName the name of the field.
@@ -352,7 +352,7 @@ default MqlDate getDate(final String fieldName, final Instant other) {
352352
* <p>Warning: The type and presence of the resulting value is not
353353
* enforced by the API. The use of this method is an
354354
* unchecked assertion that the document
355-
* {@linkplain #has(String) has} the named field and
355+
* {@linkplain #hasField(String) has} the named field and
356356
* the field value is of the specified type.
357357
*
358358
* @mongodb.server.release 5.0
@@ -366,7 +366,7 @@ default MqlDate getDate(final String fieldName, final Instant other) {
366366
* Returns the {@linkplain MqlDocument document} value of the field
367367
* with the provided {@code fieldName},
368368
* or the {@code other} value
369-
* if the document {@linkplain #has} no such field,
369+
* if the document {@linkplain #hasField} no such field,
370370
* or if the specified field is not a (child) document
371371
* (or other {@linkplain MqlValue#isDocumentOr document-like value}.
372372
*
@@ -381,7 +381,7 @@ default MqlDate getDate(final String fieldName, final Instant other) {
381381
* Returns the {@linkplain MqlDocument document} value of the field
382382
* with the provided {@code fieldName},
383383
* or the {@code other} value
384-
* if the document {@linkplain #has} no such field,
384+
* if the document {@linkplain #hasField} no such field,
385385
* or if the specified field is not a (child) document
386386
* (or other {@linkplain MqlValue#isDocumentOr document-like value}.
387387
*
@@ -403,7 +403,7 @@ default MqlDocument getDocument(final String fieldName, final Bson other) {
403403
* <p>Warning: The type and presence of the resulting value is not
404404
* enforced by the API. The use of this method is an
405405
* unchecked assertion that the document
406-
* {@linkplain #has(String) has} the named field,
406+
* {@linkplain #hasField(String) has} the named field,
407407
* and the field value is of the specified raw type,
408408
* and the field value's type has the specified type argument.
409409
*
@@ -420,7 +420,7 @@ default MqlDocument getDocument(final String fieldName, final Bson other) {
420420
* Returns the {@linkplain MqlMap map} value of the field
421421
* with the provided {@code fieldName},
422422
* or the {@code other} value
423-
* if the document {@linkplain #has} no such field,
423+
* if the document {@linkplain #hasField} no such field,
424424
* or if the specified field is not a map
425425
* (or other {@linkplain MqlValue#isMapOr} map-like value}).
426426
*
@@ -440,7 +440,7 @@ default MqlDocument getDocument(final String fieldName, final Bson other) {
440440
* Returns the {@linkplain MqlMap map} value of the field
441441
* with the provided {@code fieldName},
442442
* or the {@code other} value
443-
* if the document {@linkplain #has} no such field,
443+
* if the document {@linkplain #hasField} no such field,
444444
* or if the specified field is not a map
445445
* (or other {@linkplain MqlValue#isMapOr} map-like value}).
446446
*
@@ -467,7 +467,7 @@ default MqlDocument getDocument(final String fieldName, final Bson other) {
467467
* <p>Warning: The type and presence of the resulting value is not
468468
* enforced by the API. The use of this method is an
469469
* unchecked assertion that the document
470-
* {@linkplain #has(String) has} the named field,
470+
* {@linkplain #hasField(String) has} the named field,
471471
* and the field value is of the specified raw type,
472472
* and the field value's type has the specified type argument.
473473
*
@@ -483,7 +483,7 @@ default MqlDocument getDocument(final String fieldName, final Bson other) {
483483
* Returns the {@linkplain MqlArray array} value of the field
484484
* with the provided {@code fieldName},
485485
* or the {@code other} value if the field is not an array
486-
* or if the document {@linkplain #has} no such field.
486+
* or if the document {@linkplain #hasField} no such field.
487487
*
488488
* <p>Warning: The type argument of the resulting value is not
489489
* enforced by the API. The use of this method is an

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

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -696,23 +696,23 @@ public MqlArray<T> minN(final MqlInteger n) {
696696
}
697697

698698
@Override
699-
public MqlString join(final Function<? super T, MqlString> mapper) {
699+
public MqlString joinStrings(final Function<? super T, MqlString> mapper) {
700700
Assertions.notNull("mapper", mapper);
701701
MqlExpression<MqlString> array = (MqlExpression<MqlString>) this.map(mapper);
702-
return array.reduce(of(""), (a, b) -> a.concat(b));
702+
return array.reduce(of(""), (a, b) -> a.append(b));
703703
}
704704

705705
@SuppressWarnings("unchecked")
706706
@Override
707-
public <R extends MqlValue> MqlArray<R> concat(final Function<? super T, ? extends MqlArray<? extends R>> mapper) {
707+
public <R extends MqlValue> MqlArray<R> concatArrays(final Function<? super T, ? extends MqlArray<? extends R>> mapper) {
708708
Assertions.notNull("mapper", mapper);
709709
MqlExpression<MqlArray<R>> array = (MqlExpression<MqlArray<R>>) this.map(mapper);
710710
return array.reduce(MqlValues.ofArray(), (a, b) -> a.concat(b));
711711
}
712712

713713
@SuppressWarnings("unchecked")
714714
@Override
715-
public <R extends MqlValue> MqlArray<R> union(final Function<? super T, ? extends MqlArray<? extends R>> mapper) {
715+
public <R extends MqlValue> MqlArray<R> unionArrays(final Function<? super T, ? extends MqlArray<? extends R>> mapper) {
716716
Assertions.notNull("mapper", mapper);
717717
Assertions.notNull("mapper", mapper);
718718
MqlExpression<MqlArray<R>> array = (MqlExpression<MqlArray<R>>) this.map(mapper);
@@ -839,7 +839,7 @@ public MqlInteger abs() {
839839
}
840840

841841
@Override
842-
public MqlDate millisecondsToDate() {
842+
public MqlDate millisecondsAsDate() {
843843
return newMqlExpression(ast("$toDate"));
844844
}
845845

@@ -988,18 +988,18 @@ public MqlString toUpper() {
988988
}
989989

990990
@Override
991-
public MqlString concat(final MqlString other) {
991+
public MqlString append(final MqlString other) {
992992
Assertions.notNull("other", other);
993993
return new MqlExpression<>(ast("$concat", other));
994994
}
995995

996996
@Override
997-
public MqlInteger strLen() {
997+
public MqlInteger length() {
998998
return new MqlExpression<>(ast("$strLenCP"));
999999
}
10001000

10011001
@Override
1002-
public MqlInteger strLenBytes() {
1002+
public MqlInteger lengthBytes() {
10031003
return new MqlExpression<>(ast("$strLenBytes"));
10041004
}
10051005

@@ -1025,7 +1025,7 @@ public MqlBoolean has(final MqlString key) {
10251025

10261026

10271027
@Override
1028-
public MqlBoolean has(final String fieldName) {
1028+
public MqlBoolean hasField(final String fieldName) {
10291029
Assertions.notNull("fieldName", fieldName);
10301030
return this.has(of(fieldName));
10311031
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ default MqlInteger subtract(final int other) {
119119
* @mongodb.server.release 4.0
120120
* @return the resulting value.
121121
*/
122-
MqlDate millisecondsToDate();
122+
MqlDate millisecondsAsDate();
123123

124124
/**
125125
* The result of passing {@code this} value to the provided function.

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,21 +54,21 @@ public interface MqlString extends MqlValue {
5454
* @param other the other value.
5555
* @return the resulting value.
5656
*/
57-
MqlString concat(MqlString other);
57+
MqlString append(MqlString other);
5858

5959
/**
6060
* The number of Unicode code points in {@code this} string.
6161
*
6262
* @return the resulting value.
6363
*/
64-
MqlInteger strLen();
64+
MqlInteger length();
6565

6666
/**
6767
* The number of UTF-8 encoded bytes in {@code this} string.
6868
*
6969
* @return the resulting value.
7070
*/
71-
MqlInteger strLenBytes();
71+
MqlInteger lengthBytes();
7272

7373
/**
7474
* The substring of {@code this} string, from the {@code start} index

0 commit comments

Comments
 (0)