Interface LuaValue

All Superinterfaces:
LuaTableTrait, Map<LuaValue,LuaValue>
All Known Implementing Classes:
AbstractLuaValue, AbstractRefLuaValue, ImmutableLuaValue, LuaTableValue, RefLuaValue

public interface LuaValue extends LuaTableTrait
A simple wrapper of references to Lua 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

      void push(Lua L) throws LuaException
      Pushes the Lua value onto the Lua stack of another thread sharing the same main state
      Parameters:
      L - another thread
      Throws:
      LuaException
    • call

      LuaValue[] call(Object... parameters)
      Performs thisLuaValue(parameter1, parameter2, ...)
      Parameters:
      parameters - the parameters
      Returns:
      the return values, null on 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()
      Overrides:
      toString in class Object
    • toBuffer

      ByteBuffer toBuffer()
    • toProxy

      <T> T toProxy(Class<T> targetInterface)
      Creates a proxy from this value with Lua.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

      Object toProxy(Class<?>[] interfaces, Lua.Conversion degree)
      Creates a proxy from this value with Lua.createProxy(Class[], Lua.Conversion).
      Parameters:
      interfaces - the interfaces the proxy should implement.
      degree - the conversion used
      Returns:
      the proxy object