The previous recipe mentions that a
tMap expression cannot be more than a single line of Java code. This means that we cannot use the normal if-then-else logic to test for conditions.
Fortunately, Java does provide a mechanism by which we can perform tests on a single line: the ternary expression.
Open the job
We'll be looking at two similar scenarios using the ternary expression.
tMapand click the output
customer.countryOfBirth.equals("UK") ? "UK" : "RestOfWorld"