Project to learn java functional programming
It is a functional interface that takes a single argument and returns a value.
- Example:
Function<String, Integer> length = x -> x.length();
It is similar to Function, but it takes two arguments and returns a value.
- Example:
BiFunction<Integer, Integer, Integer> sum = (x, y) -> x + y
It takes a single argument and does not return a value.
- Example:
Consumer<String> print = x -> System.out.println(x);
It is similar to Consumer, but it takes two arguments and does not return a value.
- Example:
BiConsumer<String, String> print = (x, y) -> System.out.println(x + y);
It takes a single argument and returns a boolean value.
- Example:
Predicate<String> isEmpty = x -> x.isEmpty();
It does not take any argument and returns a value.
- Example:
Supplier<String> randomUUID = () -> UUID.randomUUID().toString();