private void generateRxInterface ( String daoFactory , RxInterfaceType interfaceType , Class < ? > clazz ) { // create interfaces { ParameterizedTypeName parameterizedTypeName = ParameterizedTypeName . get ( ClassName . get ( clazz ) , TypeVariableName . get ( "T" ) ) ; String preExecutorName = clazz . getSimpleName ( ) . replace ( "Emitter" , "" ) ; String postExecutorName = com . abubusoft . kripton . common . CaseFormat . UPPER_UNDERSCORE . to ( CaseFormat . UPPER_CAMEL , interfaceType . toString ( ) ) ; // @formatter:off if ( interfaceType == RxInterfaceType . BATCH ) { classBuilder . addType ( TypeSpec . interfaceBuilder ( preExecutorName + postExecutorName ) . addModifiers ( Modifier . PUBLIC ) . addTypeVariable ( TypeVariableName . get ( "T" ) ) . addMethod ( MethodSpec . methodBuilder ( "onExecute" ) . addParameter ( className ( daoFactory ) , "daoFactory" ) . addParameter ( parameterizedTypeName , "emitter" ) . addModifiers ( Modifier . PUBLIC , Modifier . ABSTRACT ) . returns ( Void . TYPE ) . build ( ) ) // .addModifiers(Modifier.PUBLIC, // Modifier.ABSTRACT).returns(TransactionResult.class).build()) . build ( ) ) ; } else { classBuilder . addType ( TypeSpec . interfaceBuilder ( preExecutorName + postExecutorName ) . addModifiers ( Modifier . PUBLIC ) . addTypeVariable ( TypeVariableName . get ( "T" ) ) . addMethod ( MethodSpec . methodBuilder ( "onExecute" ) . addParameter ( className ( daoFactory ) , "daoFactory" ) . addParameter ( parameterizedTypeName , "emitter" ) // .addModifiers(Modifier.PUBLIC, // Modifier.ABSTRACT).returns(Void.TYPE).build()) . addModifiers ( Modifier . PUBLIC , Modifier . ABSTRACT ) . returns ( TransactionResult . class ) . build ( ) ) . build ( ) ) ; } // @formatter:on } }
Generate rx interface .