Aside - Type Mapping Reference
| Lua Type | Java Type |
|---|---|
nil | null |
number | byte, short, int, long, float, double, Byte, Short, Int, Long, Float, Double [1] |
boolean | boolean, Boolean |
string | String |
function | instance [2] |
table | See Source code[3] |
userdata | instance, Class, EClass [4] |
If a number greater than the max size of the Java type is provided, it overflows, wrapping around. (ex. if passing 256 where a byte is expected, the resulting byte will be 0) ↩︎
When going from Lua to Java, converted to an instance of a functional interface (java interface with only one method), where applicable. see Callback Methods ↩︎
When going from Java to Lua, converted only if the java method's return value is annotated with
@CoerceToNative. When going from Lua to Java, converted unconditionally. ↩︎Java classes and objects are wrapped as userdata. Additionally, where a
ClassorEClassare expected, a userdata passed directly fromrequirecan be used. ↩︎