Class PartialFunctionApplication

java.lang.Object
org.occurrent.application.composition.command.partial.PartialFunctionApplication

public class PartialFunctionApplication extends Object
Utility for creating partial function applications for "commands", e.g. (Function<List<T>, List<T>> , Function<Stream<T>, Stream<T>> etc. For example let's say you have a domain function defined like this in MyClass:
 public List<DomainEvent> someDomainFunction(List<DomainEvent>, int someValue, String someString) {
     ...
 }
 
and you want to pass this as a command to an application service. You could do like this:
 applicationService.execute("inputid", events -> MyClass.someDomainFunction(events, 2, "my string));
 

Alternatively, you can use partial function application by using the partial methods in this class:

 applicationService.execute("inputid", partial(Class::someDomainFunction, 2, "my string));