java.lang.Object
com.legyver.utils.nippe.AbstractStepExecutor<T>
com.legyver.utils.nippe.Step<T,U>
public class Step<T,U> extends AbstractStepExecutor<T>
decorator-based mechanism for constructing NPE-safe chained getters: see
com.legyver.util.nippe.StepTest
- Since:
- 2.0
-
Constructor Summary
Constructors Constructor Description Step(AbstractStepExecutor<U> decorated, java.util.function.Function<U,T> function)Constructor to create a Step -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
Step
Constructor to create a Step- Parameters:
decorated- the previous Step or Basefunction- the function to be evaluated if the node is not null
-
-
Method Details
-
execute
Take a step Executes the Function if the result of the previous Base/Step is not null- Specified by:
executein classAbstractStepExecutor<T>- Returns:
- null if the result of the previous step is null, the result of the function when applied to the result otherwise
-