JExpression condition = lit(propertyName).invoke("equals").arg(nameParam); propertyConditional = propertyConditional == null ? propertyConditional = body._if(condition) : propertyConditional._elseif(condition);
propertyConditional = body._if(condition); } else { propertyConditional = propertyConditional._elseif(condition);
JExpression condition = lit(propertyName).invoke("equals").arg(nameParam); propertyConditional = propertyConditional == null ? propertyConditional = body._if(condition) : propertyConditional._elseif(condition);
propertyConditional = body._if(condition); } else { propertyConditional = propertyConditional._elseif(condition);
conditional = elseBlock._if(ifExpression); } catch (Exception e) { conditional = conditional._elseif(ifExpression);
cand(compareRightExprHolder.getIsSet().eq(JExpr.lit(0)))); jc._then()._return(JExpr.lit(1)); jc._elseif(out.getValue().ne(JExpr.lit(0)))._then()._return(out.getValue()); } else { cg.getEvalBlock()._if(out.getValue().ne(JExpr.lit(0)))._then()._return(out.getValue());
private void generateEquals() { equalsGeneric = cls().method(JMod.PUBLIC, cm.BOOLEAN, "equals"); equalsGeneric.param(cm.ref("java.lang.Object"), "other"); equalsGeneric.body().block()._if(_this().eq(ref("other"))) ._then() ._return(TRUE); equalsGeneric.body().block()._if( ref("other").eq(_null()) .cor((ref("other")._instanceof(cls()).not()))) ._then() ._return(FALSE); equalsGeneric.body().block()._return(_this().invoke("equals").arg(cast(cls(), ref("other")))); equalsTypeSpecific = cls().method(JMod.PUBLIC, cm.BOOLEAN, "equals"); equalsTypeSpecific.param(cls(), "other"); equalsTypeSpecific.body().block()._if(ref("other").eq(_null()))._then()._return(FALSE); JConditional test = equalsTypeSpecific.body().block()._if(_this().ref("value").eq(_null()).cand(ref("other").invoke("getValue").ne(_null()))); test._then().block()._return(FALSE); JConditional test2 = test._elseif(_this().ref("value").ne(_null()).cand(ref("other").invoke("getValue").eq(_null()))); test2._then().block()._return(FALSE); JConditional test3 = test2._elseif(_this().ref("value").eq(_null()).cand(ref("other").invoke("getValue").eq(_null()))); test3._then().block()._return(TRUE); test3._else().block()._return(_this().ref("value").invoke("equals").arg(ref("other").invoke("getValue"))); }