Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 1 | // automatically generated by the FlatBuffers compiler, do not modify |
| 2 | |
| 3 | package MyGame.Example; |
| 4 | |
| 5 | import java.nio.*; |
| 6 | import java.lang.*; |
| 7 | import java.util.*; |
| 8 | import com.google.flatbuffers.*; |
| 9 | |
| 10 | @SuppressWarnings("unused") |
| 11 | final class TestSimpleTableWithEnum extends Table { |
James Kuszmaul | 3b15b0c | 2022-11-08 14:03:16 -0800 | [diff] [blame^] | 12 | public static void ValidateVersion() { Constants.FLATBUFFERS_22_10_26(); } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 13 | public static TestSimpleTableWithEnum getRootAsTestSimpleTableWithEnum(ByteBuffer _bb) { return getRootAsTestSimpleTableWithEnum(_bb, new TestSimpleTableWithEnum()); } |
| 14 | public static TestSimpleTableWithEnum getRootAsTestSimpleTableWithEnum(ByteBuffer _bb, TestSimpleTableWithEnum 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 TestSimpleTableWithEnum __assign(int _i, ByteBuffer _bb) { __init(_i, _bb); return this; } |
| 17 | |
| 18 | public int color() { int o = __offset(4); return o != 0 ? bb.get(o + bb_pos) & 0xFF : 2; } |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 19 | public boolean mutateColor(int color) { int o = __offset(4); if (o != 0) { bb.put(o + bb_pos, (byte) color); return true; } else { return false; } } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 20 | |
| 21 | public static int createTestSimpleTableWithEnum(FlatBufferBuilder builder, |
| 22 | int color) { |
| 23 | builder.startTable(1); |
| 24 | TestSimpleTableWithEnum.addColor(builder, color); |
| 25 | return TestSimpleTableWithEnum.endTestSimpleTableWithEnum(builder); |
| 26 | } |
| 27 | |
| 28 | public static void startTestSimpleTableWithEnum(FlatBufferBuilder builder) { builder.startTable(1); } |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 29 | public static void addColor(FlatBufferBuilder builder, int color) { builder.addByte(0, (byte) color, (byte) 2); } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 30 | public static int endTestSimpleTableWithEnum(FlatBufferBuilder builder) { |
| 31 | int o = builder.endTable(); |
| 32 | return o; |
| 33 | } |
Austin Schuh | 272c613 | 2020-11-14 16:37:52 -0800 | [diff] [blame] | 34 | |
| 35 | static final class Vector extends BaseVector { |
| 36 | public Vector __assign(int _vector, int _element_size, ByteBuffer _bb) { __reset(_vector, _element_size, _bb); return this; } |
| 37 | |
| 38 | public TestSimpleTableWithEnum get(int j) { return get(new TestSimpleTableWithEnum(), j); } |
| 39 | public TestSimpleTableWithEnum get(TestSimpleTableWithEnum obj, int j) { return obj.__assign(__indirect(__element(j), bb), bb); } |
| 40 | } |
James Kuszmaul | 8e62b02 | 2022-03-22 09:33:25 -0700 | [diff] [blame] | 41 | public TestSimpleTableWithEnumT unpack() { |
| 42 | TestSimpleTableWithEnumT _o = new TestSimpleTableWithEnumT(); |
| 43 | unpackTo(_o); |
| 44 | return _o; |
| 45 | } |
| 46 | public void unpackTo(TestSimpleTableWithEnumT _o) { |
| 47 | int _oColor = color(); |
| 48 | _o.setColor(_oColor); |
| 49 | } |
| 50 | public static int pack(FlatBufferBuilder builder, TestSimpleTableWithEnumT _o) { |
| 51 | if (_o == null) return 0; |
| 52 | return createTestSimpleTableWithEnum( |
| 53 | builder, |
| 54 | _o.getColor()); |
| 55 | } |
Austin Schuh | e89fa2d | 2019-08-14 20:24:23 -0700 | [diff] [blame] | 56 | } |
| 57 | |