mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 04:04:19 +00:00
* [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521) * [Java] ObjectAPI implementation (#6521)
This commit is contained in:
@@ -22,15 +22,15 @@ public final class StructOfStructs extends Struct {
|
||||
public static int createStructOfStructs(FlatBufferBuilder builder, long a_id, long a_distance, short b_a, byte b_b, long c_id, long c_distance) {
|
||||
builder.prep(4, 20);
|
||||
builder.prep(4, 8);
|
||||
builder.putInt((int)c_distance);
|
||||
builder.putInt((int)c_id);
|
||||
builder.putInt((int) c_distance);
|
||||
builder.putInt((int) c_id);
|
||||
builder.prep(2, 4);
|
||||
builder.pad(1);
|
||||
builder.putByte(b_b);
|
||||
builder.putShort(b_a);
|
||||
builder.prep(4, 8);
|
||||
builder.putInt((int)a_distance);
|
||||
builder.putInt((int)a_id);
|
||||
builder.putInt((int) a_distance);
|
||||
builder.putInt((int) a_id);
|
||||
return builder.offset();
|
||||
}
|
||||
|
||||
@@ -40,5 +40,32 @@ public final class StructOfStructs extends Struct {
|
||||
public StructOfStructs get(int j) { return get(new StructOfStructs(), j); }
|
||||
public StructOfStructs get(StructOfStructs obj, int j) { return obj.__assign(__element(j), bb); }
|
||||
}
|
||||
public StructOfStructsT unpack() {
|
||||
StructOfStructsT _o = new StructOfStructsT();
|
||||
unpackTo(_o);
|
||||
return _o;
|
||||
}
|
||||
public void unpackTo(StructOfStructsT _o) {
|
||||
a().unpackTo(_o.getA());
|
||||
b().unpackTo(_o.getB());
|
||||
c().unpackTo(_o.getC());
|
||||
}
|
||||
public static int pack(FlatBufferBuilder builder, StructOfStructsT _o) {
|
||||
if (_o == null) return 0;
|
||||
int _a_id = _o.getA().getId();
|
||||
int _a_distance = _o.getA().getDistance();
|
||||
short _b_a = _o.getB().getA();
|
||||
byte _b_b = _o.getB().getB();
|
||||
int _c_id = _o.getC().getId();
|
||||
int _c_distance = _o.getC().getDistance();
|
||||
return createStructOfStructs(
|
||||
builder,
|
||||
_a_id,
|
||||
_a_distance,
|
||||
_b_a,
|
||||
_b_b,
|
||||
_c_id,
|
||||
_c_distance);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user