Package party.iroiro.luajava.value
Interface LuaValue
- All Superinterfaces:
LuaTableTrait,Map<LuaValue,LuaValue>
- All Known Implementing Classes:
AbstractLuaValue,AbstractRefLuaValue,ImmutableLuaValue,LuaTableValue,RefLuaValue
A simple wrapper of references to Lua values
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionLuaValue[]PerformsthisLuaValue(parameter1, parameter2, ...)voidPushes the Lua value onto the Lua stack of another thread sharing the same main statestate()Returns the Lua state where this value resides.booleantoBuffer()long@Nullable ObjectConverts this Lua value to a Java object.doubletoNumber()toProxy(Class<?>[] interfaces, Lua.Conversion degree) Creates a proxy from this value withLua.createProxy(Class[], Lua.Conversion).<T> TCreates a proxy from this value withLua.createProxy(Class[], Lua.Conversion).toString()type()Returns the type of this Lua value.Methods inherited from interface party.iroiro.luajava.value.LuaTableTrait
get, get, get, get, length, put, set, set, sizeMethods inherited from interface java.util.Map
clear, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, equals, forEach, getOrDefault, hashCode, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, values
-
Method Details
-
type
Lua.LuaType type()Returns the type of this Lua value.- Returns:
- the type of the Lua value
-
state
Lua state()Returns the Lua state where this value resides.- Returns:
- the Lua state where this Lua value lives
-
push
Pushes the Lua value onto the Lua stack of another thread sharing the same main state- Parameters:
L- another thread- Throws:
LuaException
-
call
PerformsthisLuaValue(parameter1, parameter2, ...)- Parameters:
parameters- the parameters- Returns:
- the return values,
nullon error
-
toJavaObject
@Nullable Object toJavaObject()Converts this Lua value to a Java object.- Returns:
- a Java value converted from this Lua value
- See Also:
-
toBoolean
boolean toBoolean() -
toInteger
long toInteger() -
toNumber
double toNumber() -
toString
String toString() -
toBuffer
ByteBuffer toBuffer() -
toProxy
Creates a proxy from this value withLua.createProxy(Class[], Lua.Conversion).- Type Parameters:
T- the type of the proxy interface- Parameters:
targetInterface- the interfaces the proxy should implement.- Returns:
- the proxy object
-
toProxy
Creates a proxy from this value withLua.createProxy(Class[], Lua.Conversion).- Parameters:
interfaces- the interfaces the proxy should implement.degree- the conversion used- Returns:
- the proxy object
-