Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Force Vertx Rx CodeGen To Generate MayBe As Return Type(Kotlin) #71

Open
c-nnooka opened this issue Jul 30, 2018 · 0 comments
Open

Force Vertx Rx CodeGen To Generate MayBe As Return Type(Kotlin) #71

c-nnooka opened this issue Jul 30, 2018 · 0 comments

Comments

@c-nnooka
Copy link

I am using following Kotlin code to generate proxy (This will also generate Rx methods)

@ProxyGen
@VertxGen
interface JobService {
    @Fluent
    fun getCertain(jobId: Int, handler: Handler<AsyncResult<Job?>>): JobService
}

When I see generated Rx Code it is as follows.

public Single<Job> rxGetCertain(int jobId) { 
   return new io.vertx.reactivex.core.impl.AsyncResultSingle<Job>(handler -> {
     getCertain(jobId, handler);
   });
}

Issue:-

Unfortunately i am not able to use this in Kotlin as kotlin won't allow null values for non-null fields and it is throwing following exception.

java.lang.IllegalArgumentException: Parameter specified as non-null is null

How do i force Vertx CodeGen to generate return type as MayBe so that my code works without any issues in kotlin.

Note: I have tried adding @nullable but no use

i have added Sample Project Here

https://github.com/c-nnooka/VertxCodeGenMayBe

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant