[Java] ObjectAPI implementation (#6521) (#6582)

* [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:
ofirm93
2021-06-04 00:17:40 +03:00
committed by GitHub
parent baaffbaedd
commit 7c3e267e1e
77 changed files with 3538 additions and 238 deletions

View File

@@ -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);
}
}