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
This commit is contained in:
Edward
2019-08-19 12:46:48 -07:00
committed by Wouter van Oortmerssen
parent acc9990abd
commit a20e71ac96
5 changed files with 38 additions and 0 deletions

View File

@@ -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.
*/