Short answer: You can't.
All Thrift structs
are expected to be generated code. For some languages, partial classes are created which (e.g. C#) can help in such situations, but not for all. Also, in some cases (C++) the base class can be customized to some extent. For Java, the
struct Foo {
1: i32 bar
}
results in a class starting with
public class foo implements org.apache.thrift.TBase<foo, foo._Fields>,
java.io.Serializable,
Cloneable,
Comparable<foo>
which is all needed and expected by the surrounding code and structures.
One possible solution for your particular case is to convert the internal classes into Thrift classes and vice versa.
Of course, if you have a cool idea how to do this better - we are open for quality patches.