private TypeSpec generateBuilder ( RestService restService ) { TypeSpec . Builder typeBuilder = TypeSpec . classBuilder ( restService . getBuilderSimpleClassName ( ) ) . addModifiers ( Modifier . PUBLIC , Modifier . FINAL ) . addJavadoc ( "Generated REST service builder for {@link $L}.\n" , restService . getTypeElement ( ) . getQualifiedName ( ) ) . addMethod ( MethodSpec . constructorBuilder ( ) . addModifiers ( Modifier . PRIVATE ) . build ( ) ) ; Map < TypeMirror , MethodSpec > mapperGetters = buildMappers ( typeBuilder , restService ) ; for ( RestServiceMethod method : restService . getMethods ( ) ) { buildMethod ( typeBuilder , mapperGetters , method ) ; } return typeBuilder . build ( ) ; }
Generate the rest service builder