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 ofthis
value.default MqlInteger
add
(int other) The sum of addingthis
and theother
value.add
(MqlInteger other) The sum of addingthis
and theother
value.max
(MqlInteger other) The date corresponding tothis
value when taken to be the number of milliseconds since the Unix epoch.min
(MqlInteger other) default MqlInteger
multiply
(int other) The product of multiplyingthis
and theother
value.multiply
(MqlInteger other) The product of multiplyingthis
and theother
value.<R extends MqlValue>
RpassIntegerTo
(Function<? super MqlInteger, ? extends R> f) The result of passingthis
value to the provided function.default MqlInteger
subtract
(int other) The difference of subtracting theother
value fromthis
.subtract
(MqlInteger other) The difference of subtracting theother
value fromthis
.<R extends MqlValue>
RswitchIntegerOn
(Function<Branches<MqlInteger>, ? extends BranchesTerminal<MqlInteger, ? extends R>> mapping) The result of applying the provided switch mapping tothis
value.Methods inherited from interface com.mongodb.client.model.mql.MqlNumber
add, add, divide, divide, max, min, multiply, multiply, passNumberTo, round, round, subtract, subtract, switchNumberOn
Methods 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 multiplyingthis
and theother
value.- Parameters:
other
- the other value.- Returns:
- the resulting value.
-
multiply
The product of multiplyingthis
and theother
value.- Parameters:
other
- the other value.- Returns:
- the resulting value.
-
add
The sum of addingthis
and theother
value.- Parameters:
other
- the other value.- Returns:
- the resulting value.
-
add
The sum of addingthis
and theother
value.- Parameters:
other
- the other value.- Returns:
- the resulting value.
-
subtract
The difference of subtracting theother
value fromthis
.- Parameters:
other
- the other value.- Returns:
- the resulting value.
-
subtract
The difference of subtracting theother
value 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 ofthis
value. -
millisecondsAsDate
MqlDate millisecondsAsDate()The date corresponding tothis
value 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 passingthis
value 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 tothis
value.- Type Parameters:
R
- the type of the resulting value.- Parameters:
mapping
- the switch mapping.- Returns:
- the resulting value.
- See Also:
-