@Override protected void genMethods(ClassModel model, MethodInfo method, List<String> cacheDecls, PrintWriter writer) { genMethod(model, method, cacheDecls, writer); MethodInfo flowableOverload = genOverloadedMethod(method, io.reactivex.Flowable.class); MethodInfo observableOverload = genOverloadedMethod(method, io.reactivex.Observable.class); if (flowableOverload != null) { genMethod(model, flowableOverload, cacheDecls, writer); } if (observableOverload != null) { genMethod(model, observableOverload, cacheDecls, writer); } }
@Override public Stream<Generator<?>> loadGenerators(ProcessingEnvironment processingEnv) { return Stream.of(new RxJava2Generator()); } }
@Override protected void genToSubscriber(ApiTypeInfo type, PrintWriter writer) { TypeInfo streamType = type.getWriteStreamArg(); writer.format(" private io.vertx.reactivex.WriteStreamObserver<%s> observer;%n", genTypeName(streamType)); writer.format(" private io.vertx.reactivex.WriteStreamSubscriber<%s> subscriber;%n", genTypeName(streamType)); writer.println(); genToXXXEr(streamType, "Observer", "observer", writer); genToXXXEr(streamType, "Subscriber", "subscriber", writer); }
public <U> void methodWithHandlerClassTypeParameterized(Class<U> type, Handler<io.vertx.reactivex.codegen.testmodel.GenericRefedInterface<U>> handler) { delegate.methodWithHandlerClassTypeParameterized(io.vertx.lang.reactivex.Helper.unwrap(type), new Handler<io.vertx.codegen.testmodel.GenericRefedInterface<U>>() { public void handle(io.vertx.codegen.testmodel.GenericRefedInterface<U> event) { handler.handle(io.vertx.reactivex.codegen.testmodel.GenericRefedInterface.newInstance(event, io.vertx.lang.rx.TypeArg.of(type))); } }); }
@Override protected void genToObservable(ApiTypeInfo type, PrintWriter writer) { TypeInfo streamType = type.getReadStreamArg(); writer.print(" private io.reactivex.Observable<"); writer.print(genTypeName(streamType)); writer.println("> observable;"); writer.print(" private io.reactivex.Flowable<"); writer.print(genTypeName(streamType)); writer.println("> flowable;"); writer.println(); genToXXXAble(streamType, "Observable", "observable", writer); genToXXXAble(streamType, "Flowable", "flowable", writer); }
public <U> void methodWithClassTypeHandler(Class<U> type, Handler<U> f) { delegate.methodWithClassTypeHandler(io.vertx.lang.reactivex.Helper.unwrap(type), new Handler<U>() { public void handle(U event) { f.handle((U)io.vertx.lang.rx.TypeArg.of(type).wrap(event)); } }); }
public <U> void methodWithHandlerAsyncResultClassTypeParameterized(Class<U> type, Handler<AsyncResult<io.vertx.reactivex.codegen.testmodel.GenericRefedInterface<U>>> handler) { delegate.methodWithHandlerAsyncResultClassTypeParameterized(io.vertx.lang.reactivex.Helper.unwrap(type), new Handler<AsyncResult<io.vertx.codegen.testmodel.GenericRefedInterface<U>>>() { public void handle(AsyncResult<io.vertx.codegen.testmodel.GenericRefedInterface<U>> ar) { if (ar.succeeded()) { handler.handle(io.vertx.core.Future.succeededFuture(io.vertx.reactivex.codegen.testmodel.GenericRefedInterface.newInstance(ar.result(), io.vertx.lang.rx.TypeArg.of(type)))); } else { handler.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); }
public <U> void methodWithHandlerAsyncResultClassTypeParameterized(Class<U> type, Handler<AsyncResult<io.vertx.reactivex.codegen.testmodel.GenericRefedInterface<U>>> handler) { delegate.methodWithHandlerAsyncResultClassTypeParameterized(io.vertx.lang.reactivex.Helper.unwrap(type), new Handler<AsyncResult<io.vertx.codegen.testmodel.GenericRefedInterface<U>>>() { public void handle(AsyncResult<io.vertx.codegen.testmodel.GenericRefedInterface<U>> ar) { if (ar.succeeded()) { handler.handle(io.vertx.core.Future.succeededFuture(io.vertx.reactivex.codegen.testmodel.GenericRefedInterface.newInstance(ar.result(), io.vertx.lang.rx.TypeArg.of(type)))); } else { handler.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); }
public <U> void methodWithClassTypeHandler(Class<U> type, Handler<U> f) { delegate.methodWithClassTypeHandler(io.vertx.lang.reactivex.Helper.unwrap(type), new Handler<U>() { public void handle(U event) { f.handle((U)io.vertx.lang.rx.TypeArg.of(type).wrap(event)); } }); }
public <U> void methodWithClassTypeFunctionReturn(Class<U> type, Function<String, U> f) { delegate.methodWithClassTypeFunctionReturn(io.vertx.lang.reactivex.Helper.unwrap(type), new java.util.function.Function<java.lang.String,U>() { public U apply(java.lang.String arg) { U ret = f.apply(arg); return io.vertx.lang.rx.TypeArg.of(type).<U>unwrap(ret); } }); }
public <U> void methodWithFunctionParamClassTypeParameterized(Class<U> type, Function<io.vertx.reactivex.codegen.testmodel.GenericRefedInterface<U>, String> handler) { delegate.methodWithFunctionParamClassTypeParameterized(io.vertx.lang.reactivex.Helper.unwrap(type), new java.util.function.Function<io.vertx.codegen.testmodel.GenericRefedInterface<U>,java.lang.String>() { public java.lang.String apply(io.vertx.codegen.testmodel.GenericRefedInterface<U> arg) { String ret = handler.apply(io.vertx.reactivex.codegen.testmodel.GenericRefedInterface.newInstance(arg, io.vertx.lang.rx.TypeArg.of(type))); return ret; } }); }
public <U> void methodWithClassTypeFunctionParam(Class<U> type, Function<U, String> f) { delegate.methodWithClassTypeFunctionParam(io.vertx.lang.reactivex.Helper.unwrap(type), new java.util.function.Function<U,java.lang.String>() { public java.lang.String apply(U arg) { String ret = f.apply((U)io.vertx.lang.rx.TypeArg.of(type).wrap(arg)); return ret; } }); }
public <U> void methodWithFunctionParamClassTypeParameterized(Class<U> type, Function<io.vertx.reactivex.codegen.testmodel.GenericRefedInterface<U>, String> handler) { delegate.methodWithFunctionParamClassTypeParameterized(io.vertx.lang.reactivex.Helper.unwrap(type), new java.util.function.Function<io.vertx.codegen.testmodel.GenericRefedInterface<U>,java.lang.String>() { public java.lang.String apply(io.vertx.codegen.testmodel.GenericRefedInterface<U> arg) { String ret = handler.apply(io.vertx.reactivex.codegen.testmodel.GenericRefedInterface.newInstance(arg, io.vertx.lang.rx.TypeArg.of(type))); return ret; } }); }
public <U> void methodWithClassTypeHandlerAsyncResult(Class<U> type, Handler<AsyncResult<U>> f) { delegate.methodWithClassTypeHandlerAsyncResult(io.vertx.lang.reactivex.Helper.unwrap(type), new Handler<AsyncResult<U>>() { public void handle(AsyncResult<U> ar) { if (ar.succeeded()) { f.handle(io.vertx.core.Future.succeededFuture((U)io.vertx.lang.rx.TypeArg.of(type).wrap(ar.result()))); } else { f.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); }
public <U> void methodWithClassTypeHandlerAsyncResult(Class<U> type, Handler<AsyncResult<U>> f) { delegate.methodWithClassTypeHandlerAsyncResult(io.vertx.lang.reactivex.Helper.unwrap(type), new Handler<AsyncResult<U>>() { public void handle(AsyncResult<U> ar) { if (ar.succeeded()) { f.handle(io.vertx.core.Future.succeededFuture((U)io.vertx.lang.rx.TypeArg.of(type).wrap(ar.result()))); } else { f.handle(io.vertx.core.Future.failedFuture(ar.cause())); } } }); }
public <U> void methodWithHandlerClassTypeParameterized(Class<U> type, Handler<io.vertx.reactivex.codegen.testmodel.GenericRefedInterface<U>> handler) { delegate.methodWithHandlerClassTypeParameterized(io.vertx.lang.reactivex.Helper.unwrap(type), new Handler<io.vertx.codegen.testmodel.GenericRefedInterface<U>>() { public void handle(io.vertx.codegen.testmodel.GenericRefedInterface<U> event) { handler.handle(io.vertx.reactivex.codegen.testmodel.GenericRefedInterface.newInstance(event, io.vertx.lang.rx.TypeArg.of(type))); } }); }
public <U> void methodWithClassTypeFunctionParam(Class<U> type, Function<U, String> f) { delegate.methodWithClassTypeFunctionParam(io.vertx.lang.reactivex.Helper.unwrap(type), new java.util.function.Function<U,java.lang.String>() { public java.lang.String apply(U arg) { String ret = f.apply((U)io.vertx.lang.rx.TypeArg.of(type).wrap(arg)); return ret; } }); }
public <U> void methodWithClassTypeFunctionReturn(Class<U> type, Function<String, U> f) { delegate.methodWithClassTypeFunctionReturn(io.vertx.lang.reactivex.Helper.unwrap(type), new java.util.function.Function<java.lang.String,U>() { public U apply(java.lang.String arg) { U ret = f.apply(arg); return io.vertx.lang.rx.TypeArg.of(type).<U>unwrap(ret); } }); }
public <T> T methodWithClassParam(Class<T> tClass) { T ret = (T)io.vertx.lang.rx.TypeArg.of(tClass).wrap(delegate.methodWithClassParam(io.vertx.lang.reactivex.Helper.unwrap(tClass))); return ret; }
public <U> U methodWithClassTypeReturn(Class<U> type) { U ret = (U)io.vertx.lang.rx.TypeArg.of(type).wrap(delegate.methodWithClassTypeReturn(io.vertx.lang.reactivex.Helper.unwrap(type))); return ret; }