Programming with Expressions
Working with basic types
Blabla.
Text
You can concatenate various text values by using the '+' operator.
Numbers
Integer, Long, BigIntegers
You can work with numbers using arithmetic operators.
Floating point numbers
BigDecimals
Dates
Immutable values, blocks
Working with collections
Tuples
Options
List and non empty list
Ranges
The following expression will compute the sum of all integer numbers from 1 to n = 1 + ... + n
Sets
Maps
Working with business entities
Higher order functions
Lambda expressions
{
let criteriaSatisfied = c: Customer => c.age >= 18;
if criteriaSatisfied(joe) 'You are eligibile'
else 'Sorry, you are not eligible'
}
Map, filter
- Transforming while keeping the structure
- ...
For comprehensions
- with filtering condition
- with type filters