Package tools.common
Interface Joinable<D,R>
- All Superinterfaces:
Function<D,R>
A joinable function
Usage
Function<Person, String> nameProvider = Joinable
.of (Person::getBoss)
.add(Person::getBoss)
.add(Person::getName);
String superBossName = nameProvider.apply(getPerson());
- Author:
- Pavel Ponec
-
Method Summary
Modifier and TypeMethodDescriptionSend a result of the first function to the next one.Applies this function to the given argument.static <D,R> @NotNull Joinable<D, R> Create a joinable function
-
Method Details
-
apply
Applies this function to the given argument. -
add
Send a result of the first function to the next one.- Type Parameters:
F- A final result type- Parameters:
next- Next function- Returns:
- If a result of the first function is
nullthan the final result isnulltoo.
-
of
Create a joinable function- Type Parameters:
D- Domain valueR- Result value- Parameters:
fce- An original function- Returns:
- The new object type of Function
-