>> 1 a long integer field?

The term "long" is vague, Thrift is explicit. Use i32 for 32-bit integers, i64 
for 64-bit integers. You probably want i64.

>> 2. a const int field (equivalent to 'static final int field' in java) ?

Struct fields can't be constants. If you just want to define a symbolic 
constant for use in your code you can say:

const i32 MY_CONSTANT = 23423;

Or you can just give a field a default-value if you want, but it won't be 
immutable.

Cheers,
mcslee

-----Original Message-----
From: Anait Markosian [mailto:[email protected]] 
Sent: Thursday, May 26, 2011 1:18 PM
To: [email protected]
Subject: Thrift IDL

 How does one represent in thrift struct :
1 a long integer field?
2. a const int field (equivalent to 'static final int field' in java) ? 

Thanks!
  • Thrift IDL Anait Markosian
    • RE: Thrift IDL Mark Slee

Reply via email to