diff options
author | Edward <ed.foux@gmail.com> | 2019-08-19 12:46:48 -0700 |
---|---|---|
committer | Wouter van Oortmerssen <aardappel@gmail.com> | 2019-08-19 12:46:48 -0700 |
commit | a20e71ac96f87d3b3af9ffc070d0e3d9a421b1f9 (patch) | |
tree | a8570683b3a04d57e46557fb5564c5ff34da75be /java/com | |
parent | acc9990abd2206491480291b0f85f925110102ea (diff) | |
download | flatbuffers-a20e71ac96f87d3b3af9ffc070d0e3d9a421b1f9.tar.gz flatbuffers-a20e71ac96f87d3b3af9ffc070d0e3d9a421b1f9.tar.bz2 flatbuffers-a20e71ac96f87d3b3af9ffc070d0e3d9a421b1f9.zip |
has_method support for primitive fields in java runtime. Changed: idl.h, FlatBufferBuilder.java , idl_gen_general.cpp, idl_parser.cpp, flatc.cpp (#5468)
* has_method support for primitive fields in java runtime
* adding the new flag to flatc
* addressing the review comments
Diffstat (limited to 'java/com')
-rw-r--r-- | java/com/google/flatbuffers/FlatBufferBuilder.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/java/com/google/flatbuffers/FlatBufferBuilder.java b/java/com/google/flatbuffers/FlatBufferBuilder.java index f224610c..4fe1c42a 100644 --- a/java/com/google/flatbuffers/FlatBufferBuilder.java +++ b/java/com/google/flatbuffers/FlatBufferBuilder.java @@ -199,6 +199,17 @@ public class FlatBufferBuilder { } } + /** + * Helper function to test if a field is present in the table + * + * @param table Flatbuffer table + * @param offset virtual table offset + * @return true if the filed is present + */ + public static boolean isFieldPresent(Table table, int offset) { + return table.__offset(offset) != 0; + } + /** * Reset the FlatBufferBuilder by purging all data that it holds. */ |