...
1// automatically generated by the FlatBuffers compiler, do not modify
2
3package NamespaceA;
4
5import java.nio.*;
6import java.lang.*;
7import java.util.*;
8import com.google.flatbuffers.*;
9
10@SuppressWarnings("unused")
11public final class TableInFirstNS extends Table {
12 public static void ValidateVersion() { Constants.FLATBUFFERS_23_5_26(); }
13 public static TableInFirstNS getRootAsTableInFirstNS(ByteBuffer _bb) { return getRootAsTableInFirstNS(_bb, new TableInFirstNS()); }
14 public static TableInFirstNS getRootAsTableInFirstNS(ByteBuffer _bb, TableInFirstNS obj) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (obj.__assign(_bb.getInt(_bb.position()) + _bb.position(), _bb)); }
15 public void __init(int _i, ByteBuffer _bb) { __reset(_i, _bb); }
16 public TableInFirstNS __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; }
17
18 public NamespaceA.NamespaceB.TableInNestedNS fooTable() { return fooTable(new NamespaceA.NamespaceB.TableInNestedNS()); }
19 public NamespaceA.NamespaceB.TableInNestedNS fooTable(NamespaceA.NamespaceB.TableInNestedNS obj) { int o = __offset(4); return o != 0 ? obj.__assign(__indirect(o + bb_pos), bb) : null; }
20 public byte fooEnum() { int o = __offset(6); return o != 0 ? bb.get(o + bb_pos) : 0; }
21 public boolean mutateFooEnum(byte foo_enum) { int o = __offset(6); if (o != 0) { bb.put(o + bb_pos, foo_enum); return true; } else { return false; } }
22 public byte fooUnionType() { int o = __offset(8); return o != 0 ? bb.get(o + bb_pos) : 0; }
23 public Table fooUnion(Table obj) { int o = __offset(10); return o != 0 ? __union(obj, o + bb_pos) : null; }
24 public NamespaceA.NamespaceB.StructInNestedNS fooStruct() { return fooStruct(new NamespaceA.NamespaceB.StructInNestedNS()); }
25 public NamespaceA.NamespaceB.StructInNestedNS fooStruct(NamespaceA.NamespaceB.StructInNestedNS obj) { int o = __offset(12); return o != 0 ? obj.__assign(o + bb_pos, bb) : null; }
26
27 public static void startTableInFirstNS(FlatBufferBuilder builder) { builder.startTable(5); }
28 public static void addFooTable(FlatBufferBuilder builder, int fooTableOffset) { builder.addOffset(0, fooTableOffset, 0); }
29 public static void addFooEnum(FlatBufferBuilder builder, byte fooEnum) { builder.addByte(1, fooEnum, 0); }
30 public static void addFooUnionType(FlatBufferBuilder builder, byte fooUnionType) { builder.addByte(2, fooUnionType, 0); }
31 public static void addFooUnion(FlatBufferBuilder builder, int fooUnionOffset) { builder.addOffset(3, fooUnionOffset, 0); }
32 public static void addFooStruct(FlatBufferBuilder builder, int fooStructOffset) { builder.addStruct(4, fooStructOffset, 0); }
33 public static int endTableInFirstNS(FlatBufferBuilder builder) {
34 int o = builder.endTable();
35 return o;
36 }
37
38 public static final class Vector extends BaseVector {
39 public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; }
40
41 public TableInFirstNS get(int j) { return get(new TableInFirstNS(), j); }
42 public TableInFirstNS get(TableInFirstNS obj, int j) { return obj.__assign(__indirect(__element(j), bb), bb); }
43 }
44 public TableInFirstNST unpack() {
45 TableInFirstNST _o = new TableInFirstNST();
46 unpackTo(_o);
47 return _o;
48 }
49 public void unpackTo(TableInFirstNST _o) {
50 if (fooTable() != null) _o.setFooTable(fooTable().unpack());
51 else _o.setFooTable(null);
52 byte _oFooEnum = fooEnum();
53 _o.setFooEnum(_oFooEnum);
54 NamespaceA.NamespaceB.UnionInNestedNSUnion _oFooUnion = new NamespaceA.NamespaceB.UnionInNestedNSUnion();
55 byte _oFooUnionType = fooUnionType();
56 _oFooUnion.setType(_oFooUnionType);
57 Table _oFooUnionValue;
58 switch (_oFooUnionType) {
59 case NamespaceA.NamespaceB.UnionInNestedNS.TableInNestedNS:
60 _oFooUnionValue = fooUnion(new NamespaceA.NamespaceB.TableInNestedNS());
61 _oFooUnion.setValue(_oFooUnionValue != null ? ((NamespaceA.NamespaceB.TableInNestedNS) _oFooUnionValue).unpack() : null);
62 break;
63 default: break;
64 }
65 _o.setFooUnion(_oFooUnion);
66 if (fooStruct() != null) fooStruct().unpackTo(_o.getFooStruct());
67 else _o.setFooStruct(null);
68 }
69 public static int pack(FlatBufferBuilder builder, TableInFirstNST _o) {
70 if (_o == null) return 0;
71 int _foo_table = _o.getFooTable() == null ? 0 : NamespaceA.NamespaceB.TableInNestedNS.pack(builder, _o.getFooTable());
72 byte _fooUnionType = _o.getFooUnion() == null ? NamespaceA.NamespaceB.UnionInNestedNS.NONE : _o.getFooUnion().getType();
73 int _fooUnion = _o.getFooUnion() == null ? 0 : NamespaceA.NamespaceB.UnionInNestedNSUnion.pack(builder, _o.getFooUnion());
74 startTableInFirstNS(builder);
75 addFooTable(builder, _foo_table);
76 addFooEnum(builder, _o.getFooEnum());
77 addFooUnionType(builder, _fooUnionType);
78 addFooUnion(builder, _fooUnion);
79 addFooStruct(builder, NamespaceA.NamespaceB.StructInNestedNS.pack(builder, _o.getFooStruct()));
80 return endTableInFirstNS(builder);
81 }
82}
83
View as plain text