Search code examples
javahadoopthrift

Apache Thrift. Method returning type changed after generation


I got an issue after regeneration my thrift file. Method returning type changed in getter and setter after generation, but structs weren't changed.

> struct Descriptor {
> 1: bool   paramOne,      
> 2: i32    paramTwo,       
> }

before:

> public void setParamTwo(List<String> paramTwo) {
>   ......
>  }

after:

> public Descriptor setParamTwo(List<String> paramTwo) {
>    ......
> }

I used

thrift -r --gen java file.thrift

There are some options for configuring it?

Thanks.


Solution

  • Okay.

    Just need to add :beans in gen command

    thrift -r --gen java:beans file.thrift