public void buildReturnCode ( MethodSpec . Builder methodBuilder , boolean updateMode , SQLiteModelMethod method , TypeName returnType ) { if ( returnType == TypeName . VOID ) { } else if ( isTypeIncludedIn ( returnType , Boolean . TYPE , Boolean . class ) ) { methodBuilder . addJavadoc ( "\n" ) ; if ( updateMode ) methodBuilder . addJavadoc ( "@return <code>true</code> if record is updated, <code>false</code> otherwise" ) ; else methodBuilder . addJavadoc ( "@return <code>true</code> if record is deleted, <code>false</code> otherwise" ) ; methodBuilder . addJavadoc ( "\n" ) ; methodBuilder . addCode ( "return result!=0;\n" ) ; } else if ( isTypeIncludedIn ( returnType , Long . TYPE , Long . class , Integer . TYPE , Integer . class , Short . TYPE , Short . class ) ) { methodBuilder . addJavadoc ( "\n" ) ; if ( updateMode ) { methodBuilder . addJavadoc ( "@return number of updated records" ) ; } else { methodBuilder . addJavadoc ( "@return number of deleted records" ) ; } methodBuilder . addJavadoc ( "\n" ) ; methodBuilder . addCode ( "return result;\n" ) ; } else { // more than one listener found throw ( new InvalidMethodSignException ( method , "invalid return type" ) ) ; } }
Builds the return code .