I want to create a lambda expression like:
// some code
CompletableFuture.handle((s,t) -> {
if(t != null){
//some code}
else{
// some code}
});
//some code
I have all logic of if-else in a CodeBlock code, and parent code in the MethodSpec method.
I am trying to add this code as follows:
method.addStament("CompletableFuture.handle((s,t) -> $N)", code.build);
which obviously is not working! Want help only for Lamda part.
Any help !
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…