Skip to content

Commit 2a5f48f

Browse files
committed
4.0 annotations (#1070)
JAVA-4799
1 parent 023a55d commit 2a5f48f

File tree

4 files changed

+9
-0
lines changed

4 files changed

+9
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,7 @@ public interface Expression {
264264
* {@linkplain EntryExpression entries}, and the
265265
* {@linkplain Expressions#ofNull() null value}.
266266
*
267+
* @mongodb.server.release 4.0
267268
* @see StringExpression#parseDate()
268269
* @see StringExpression#parseInteger()
269270
* @return the resulting value.

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ default IntegerExpression subtract(final int other) {
109109
* The {@linkplain DateExpression date} corresponding to {@code this} value
110110
* when taken to be the number of milliseconds since the Unix epoch.
111111
*
112+
* @mongodb.server.release 4.0
112113
* @return the resulting value.
113114
*/
114115
DateExpression millisecondsToDate();

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ default StringExpression substrBytes(final int start, final int length) {
127127
*
128128
* <p>This will cause an error if this string does not represent an integer.
129129
*
130+
* @mongodb.server.release 4.0
130131
* @return the resulting value.
131132
*/
132133
IntegerExpression parseInteger();
@@ -146,6 +147,7 @@ default StringExpression substrBytes(final int start, final int length) {
146147
* Converts {@code this} string to a {@linkplain DateExpression date},
147148
* using the specified {@code format}.
148149
*
150+
* @mongodb.server.release 4.0
149151
* @mongodb.driver.manual reference/operator/aggregation/dateToString/#std-label-format-specifiers Format Specifiers
150152
* @param format the format.
151153
* @return the resulting value.

driver-core/src/test/functional/com/mongodb/client/model/expressions/TypeExpressionsFunctionalTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ public void isMapOrTest() {
173173

174174
@Test
175175
public void asStringTest() {
176+
assumeTrue(serverVersionAtLeast(4, 0));
176177
// https://www.mongodb.com/docs/manual/reference/operator/aggregation/toString/
177178
// asString, since toString conflicts
178179
assertExpression("false", of(false).asString(), "{'$toString': [false]}");
@@ -198,6 +199,7 @@ public void asStringTest() {
198199

199200
@Test
200201
public void dateAsStringTest() {
202+
assumeTrue(serverVersionAtLeast(4, 0));
201203
// https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateToString/
202204
final Instant instant = Instant.parse("2007-12-03T10:15:30.005Z");
203205
DateExpression date = of(instant);
@@ -229,6 +231,7 @@ public void dateAsStringTest() {
229231

230232
@Test
231233
public void parseDateTest() {
234+
assumeTrue(serverVersionAtLeast(4, 0));
232235
// https://www.mongodb.com/docs/manual/reference/operator/aggregation/dateToString/
233236
String dateString = "2007-12-03T10:15:30.005Z";
234237
assertExpression(
@@ -253,6 +256,7 @@ public void parseDateTest() {
253256

254257
@Test
255258
public void parseIntegerTest() {
259+
assumeTrue(serverVersionAtLeast(4, 0));
256260
// https://www.mongodb.com/docs/manual/reference/operator/aggregation/toInt/
257261
// https://www.mongodb.com/docs/manual/reference/operator/aggregation/toLong/
258262
assertExpression(
@@ -292,6 +296,7 @@ public void parseIntegerTest() {
292296

293297
@Test
294298
public void millisecondsToDateTest() {
299+
assumeTrue(serverVersionAtLeast(4, 0));
295300
// https://www.mongodb.com/docs/manual/reference/operator/aggregation/toDate/
296301
assertExpression(
297302
Instant.ofEpochMilli(1234),

0 commit comments

Comments
 (0)