Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I generate a array with apache thrift

Tags:

java

thrift

I need to generate a java array with apache thrift idl. Can someone tell me how can I do that thing?

I have tride it with List.

here the code

struct subscription{
1:list<string> control_data
2:string callback_url
3:bool post_notification
}

Can I do the same thing with an array as It's difficult to deal with a list in my project.

like image 795
bula Avatar asked Nov 27 '25 06:11

bula


1 Answers

There are only list<T>, set<T> and map<K,V>. What code is generated from that IDL depends on the language. For binary data like byte[] it is recommended to use the binary type instead.

Regarding your particular problem: If it is difficult with list<>, consider converting the data into an array temporarily, while dealing with them in your application logic.

like image 171
JensG Avatar answered Nov 29 '25 19:11

JensG



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!