mirror of
https://github.com/google/flatbuffers.git
synced 2026-06-02 12:05:50 +00:00
Makes enums/structs/tables unsubclassable (final or sealed) and prevents instantiation of enum classes (which are solely static constants). Tested (Mac OS 10.10.2): 1. run flattests 2. cd tests && ../flatc -c monster_test.fbs && ../flatc -j monster_test.fbs && ../flatc -g monster_test.fbs && ../flatc -n monster_test.fbs # Note deltas for C# and Java. 3. ./JavaTest.sh **Breaking api change** Change-Id: Ie008c941c36d212690da58ddc72c9b228eb7a093
25 lines
600 B
Java
25 lines
600 B
Java
// automatically generated, do not modify
|
|
|
|
package MyGame.Example;
|
|
|
|
import java.nio.*;
|
|
import java.lang.*;
|
|
import java.util.*;
|
|
import com.google.flatbuffers.*;
|
|
|
|
public final class Test extends Struct {
|
|
public Test __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
|
|
|
|
public short a() { return bb.getShort(bb_pos + 0); }
|
|
public byte b() { return bb.get(bb_pos + 2); }
|
|
|
|
public static int createTest(FlatBufferBuilder builder, short a, byte b) {
|
|
builder.prep(2, 4);
|
|
builder.pad(1);
|
|
builder.putByte(b);
|
|
builder.putShort(a);
|
|
return builder.offset();
|
|
}
|
|
};
|
|
|