public class StaticExecutionFactoryBuilder extends DefaultExecutionFactoryBuilder<StaticExecutionFactoryBuilder> implements SupplierBuilderFactory<StaticExecutionFactoryBuilder>, RunnableBuilderFactory<StaticExecutionFactoryBuilder>
MyResult result = new StaticExecutionFactoryBuilder().execute(MyClass::myStaticMethod)
.withParam(param1)
.withParam(param2);
Where myStaticMethod is a static method on the MyClass class, param1 is the first parameter on myStaticMethod,
param2 is the second (and last) parameter on myStaticMethod and MyResult is the returning object of
myStaticMethod. This means that that execution is the equivalent of doing:
MyResult result = MyClass.myStaticMethod.myMethod(param1, param2);
Optionally, an additional execution for this executor can follow the following code:
MyClass newMyClassInstance = new StaticExecutionFactoryBuilder().execute(MyClass::new)
.withParam(param1)
.withParam(param2);
Where newMyClassInstance is an instance of the MyClass class, param1 is the first parameter on the constructor,
param2 is the second (and last) parameter on the constructor.
The advantage of doing this in this way is all the wrappers and listeners that we can add to the execution.| Constructor and Description |
|---|
StaticExecutionFactoryBuilder() |
buildExecutionFactory, withExceptionHandler, withExceptionHandler, withIgnoredExceptionType, withPostExecutionListener, withPostExecutionListener, withPreExecutionListener, withPreExecutionListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitexecute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, executeexecute, execute, execute, execute, execute, execute, execute, execute, execute, execute, execute, executebuildExecutionFactory, withExceptionHandler, withExceptionHandler, withIgnoredExceptionType, withPostExecutionListener, withPostExecutionListener, withPreExecutionListener, withPreExecutionListenerCopyright © 2019. All rights reserved.