summaryrefslogtreecommitdiff
path: root/tests/MyGame/Example/Stat.java
diff options
context:
space:
mode:
authorWouter van Oortmerssen <wvo@google.com>2014-09-25 15:53:56 -0700
committerWouter van Oortmerssen <wvo@google.com>2014-09-25 15:53:56 -0700
commit18cf19f87629b54e961e2b81542aaca5bf956ada (patch)
treed07d44b8714a1dcc2c564f74a027b295caf63baf /tests/MyGame/Example/Stat.java
parent730c0cadde2302efa1487d672a1e2f53680ce2ea (diff)
downloadflatbuffers-18cf19f87629b54e961e2b81542aaca5bf956ada.tar.gz
flatbuffers-18cf19f87629b54e961e2b81542aaca5bf956ada.tar.bz2
flatbuffers-18cf19f87629b54e961e2b81542aaca5bf956ada.zip
Fixed bug in convenient constructors for Java/C#
Also fixed Go unit tests not being up to date with recent schema changes. Change-Id: I42e619f9c5ea05f6f937c68a5c8a92462c46bce3 Tested: on Linux and Windows.
Diffstat (limited to 'tests/MyGame/Example/Stat.java')
-rw-r--r--tests/MyGame/Example/Stat.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/tests/MyGame/Example/Stat.java b/tests/MyGame/Example/Stat.java
new file mode 100644
index 00000000..66be12f1
--- /dev/null
+++ b/tests/MyGame/Example/Stat.java
@@ -0,0 +1,35 @@
+// automatically generated, do not modify
+
+package MyGame.Example;
+
+import java.nio.*;
+import java.lang.*;
+import java.util.*;
+import com.google.flatbuffers.*;
+
+public class Stat extends Table {
+ public static Stat getRootAsStat(ByteBuffer _bb) { _bb.order(ByteOrder.LITTLE_ENDIAN); return (new Stat()).__init(_bb.getInt(_bb.position()) + _bb.position(), _bb); }
+ public Stat __init(int _i, ByteBuffer _bb) { bb_pos = _i; bb = _bb; return this; }
+
+ public String id() { int o = __offset(4); return o != 0 ? __string(o + bb_pos) : null; }
+ public ByteBuffer idAsByteBuffer() { return __vector_as_bytebuffer(4, 1); }
+ public long val() { int o = __offset(6); return o != 0 ? bb.getLong(o + bb_pos) : 0; }
+
+ public static int createStat(FlatBufferBuilder builder,
+ int id,
+ long val) {
+ builder.startObject(2);
+ Stat.addVal(builder, val);
+ Stat.addId(builder, id);
+ return Stat.endStat(builder);
+ }
+
+ public static void startStat(FlatBufferBuilder builder) { builder.startObject(2); }
+ public static void addId(FlatBufferBuilder builder, int idOffset) { builder.addOffset(0, idOffset, 0); }
+ public static void addVal(FlatBufferBuilder builder, long val) { builder.addLong(1, val, 0); }
+ public static int endStat(FlatBufferBuilder builder) {
+ int o = builder.endObject();
+ return o;
+ }
+};
+