Package com.mongodb.client.model.mql
Interface MqlInteger
An integer value in the context of the MongoDB Query
Language (MQL). Integers are a subset of numbers,
and so, for example, the integer 0 and the number 0 are
equal.
- Since:
- 4.9.0
-
Method Summary
Modifier and TypeMethodDescriptionabs()The absolute value ofthisvalue.default MqlIntegeradd(int other) The sum of addingthisand theothervalue.add(MqlInteger other) The sum of addingthisand theothervalue.max(MqlInteger other) The date corresponding tothisvalue when taken to be the number of milliseconds since the Unix epoch.min(MqlInteger other) default MqlIntegermultiply(int other) The product of multiplyingthisand theothervalue.multiply(MqlInteger other) The product of multiplyingthisand theothervalue.<R extends MqlValue>
RpassIntegerTo(Function<? super MqlInteger, ? extends R> f) The result of passingthisvalue to the provided function.default MqlIntegersubtract(int other) The difference of subtracting theothervalue fromthis.subtract(MqlInteger other) The difference of subtracting theothervalue fromthis.<R extends MqlValue>
RswitchIntegerOn(Function<Branches<MqlInteger>, ? extends BranchesTerminal<MqlInteger, ? extends R>> mapping) The result of applying the provided switch mapping tothisvalue.Methods inherited from interface com.mongodb.client.model.mql.MqlNumber
add, add, divide, divide, max, min, multiply, multiply, passNumberTo, round, round, subtract, subtract, switchNumberOnMethods inherited from interface com.mongodb.client.model.mql.MqlValue
asString, eq, equals, gt, gte, isArrayOr, isBooleanOr, isDateOr, isDocumentOr, isIntegerOr, isMapOr, isNumberOr, isStringOr, lt, lte, ne, passTo, switchOn
-
Method Details
-
multiply
The product of multiplyingthisand theothervalue.- Parameters:
other- the other value.- Returns:
- the resulting value.
-
multiply
The product of multiplyingthisand theothervalue.- Parameters:
other- the other value.- Returns:
- the resulting value.
-
add
The sum of addingthisand theothervalue.- Parameters:
other- the other value.- Returns:
- the resulting value.
-
add
The sum of addingthisand theothervalue.- Parameters:
other- the other value.- Returns:
- the resulting value.
-
subtract
The difference of subtracting theothervalue fromthis.- Parameters:
other- the other value.- Returns:
- the resulting value.
-
subtract
The difference of subtracting theothervalue fromthis.- Parameters:
other- the other value.- Returns:
- the resulting value.
-
max
- Parameters:
other- the other value.- Returns:
- the resulting value.
-
min
- Parameters:
other- the other value.- Returns:
- the resulting value.
-
abs
MqlInteger abs()The absolute value ofthisvalue. -
millisecondsAsDate
MqlDate millisecondsAsDate()The date corresponding tothisvalue when taken to be the number of milliseconds since the Unix epoch.- Returns:
- the resulting value.
- Since server release
- 4.0
-
passIntegerTo
The result of passingthisvalue to the provided function. Equivalent tof.apply(this), and allows lambdas and static, user-defined functions to use the chaining syntax.- Type Parameters:
R- the type of the resulting value.- Parameters:
f- the function to apply.- Returns:
- the resulting value.
- See Also:
-
switchIntegerOn
<R extends MqlValue> R switchIntegerOn(Function<Branches<MqlInteger>, ? extends BranchesTerminal<MqlInteger, ? extends R>> mapping) The result of applying the provided switch mapping tothisvalue.- Type Parameters:
R- the type of the resulting value.- Parameters:
mapping- the switch mapping.- Returns:
- the resulting value.
- See Also:
-