Class ElseIfExpression<RETURN_TYPE>
java.lang.Object
dk.cloudcreate.essentials.shared.logic.ElseIfExpression<RETURN_TYPE>
- Type Parameters:
RETURN_TYPE- the return type from theIfThenElseLogic's return value supplier lambda or the provided fixed value
The ElseIf/Else part of an
IfExpression-
Method Summary
Modifier and TypeMethodDescriptionElse(Supplier<RETURN_TYPE> elseReturnValueSupplier) Else(RETURN_TYPE elseFixedValue) ElseIf(boolean elseIfPredicate, Supplier<RETURN_TYPE> elseIfReturnValueSupplier) ElseIf(boolean elseIfPredicate, RETURN_TYPE elseIfFixedValue) ElseIf(IfPredicate elseIfPredicate, Supplier<RETURN_TYPE> elseIfReturnValueSupplier) ElseIf(IfPredicate elseIfPredicate, RETURN_TYPE elseIfFixedValue) protected booleanevaluate()Evaluate theIfPredicateprotected dk.cloudcreate.essentials.shared.logic.IfThenElseLogic<RETURN_TYPE>getChild()Get the child (if any) of thisIfThenElseLogicelement.
The Else element in an If/(ElseIf)/Else sequence will have a child that's null.protected RETURN_TYPEResolve the Return Value
-
Method Details
-
ElseIf
public ElseIfExpression<RETURN_TYPE> ElseIf(boolean elseIfPredicate, Supplier<RETURN_TYPE> elseIfReturnValueSupplier) -
ElseIf
-
Else
-
Else
-
getChild
Get the child (if any) of thisIfThenElseLogicelement.
The Else element in an If/(ElseIf)/Else sequence will have a child that's null.- Returns:
- the child (if any) of this
IfThenElseLogicelement
-
evaluate
protected boolean evaluate()Evaluate theIfPredicate- Returns:
- the result of
IfPredicate.test()
-
resolveReturnValue
Resolve the Return Value- Returns:
- the result of the return-value
Supplier.get()
-