a == b ? c : d
Group |
Checks if parameter a equals parameter b and returns input c, otherwise input d is returned. The check depends on data types of parameters a and b.
If both arguments are of type String, a String comparison is performed.
If one argument is of type Boolean, the other one will be converted to a Boolean and a Boolean comparison is done. In all other cases, a numeric comparison will be performed using BigDecimal.
Dates and timestamps are converted to 'Unix time', i.e. the number of milliseconds since 1970-01-01 00:00:00 in order to compare the numerically.
Description of Parameters
Parameter |
Description |
a |
Value to compare to. |
b |
Value to compare to. |
c |
Value to return in case of equality of a and b. |
d |
Value to return in case of inequality of a and b. |
Examples
Parameter a |
Parameter b |
Parameter c |
Parameter d |
Result |
value |
value |
they are equal |
they are inequal |
they are equal |
value |
novalue |
they are equal |
they are inequal |
they are inequal |
See Also
Data Types / Subsection: Comparisons and types