Class ImmutableLuaValue<T extends @Nullable Object>

Type Parameters:
T - the value type
All Implemented Interfaces:
Map<LuaValue,LuaValue>, LuaTableTrait, LuaValue

public abstract class ImmutableLuaValue<T extends @Nullable Object> extends AbstractLuaValue<Lua>
Basic LuaValue implementation wrapping immutable values
  • Field Details

    • value

      protected final T extends @Nullable Object value
      The wrapped immutable value.
  • Constructor Details

    • ImmutableLuaValue

      protected ImmutableLuaValue(Lua L, Lua.LuaType type, T value)
      Creates a new ImmutableLuaValue.
      Parameters:
      L - the Lua state
      type - the Lua type
      value - the wrapped value
  • Method Details

    • toString

      public String toString()
      Specified by:
      toString in interface LuaValue
      Overrides:
      toString in class AbstractMap<LuaValue,LuaValue>
    • toJavaObject

      public @Nullable Object toJavaObject()
      Description copied from interface: LuaValue
      Converts this Lua value to a Java object.
      Returns:
      a Java value converted from this Lua value
      See Also:
    • NIL

      public static LuaValue NIL(Lua L)
      Creates a nil Lua value.
      Parameters:
      L - the Lua state
      Returns:
      a nil Lua value
    • TRUE

      public static LuaValue TRUE(Lua L)
      Creates a true boolean Lua value.
      Parameters:
      L - the Lua state
      Returns:
      a true Lua value
    • FALSE

      public static LuaValue FALSE(Lua L)
      Creates a false boolean Lua value.
      Parameters:
      L - the Lua state
      Returns:
      a false Lua value
    • NUMBER

      public static LuaValue NUMBER(Lua L, double n)
      Creates a number Lua value from a double.
      Parameters:
      L - the Lua state
      n - the number value
      Returns:
      a number Lua value
    • LONG

      public static LuaValue LONG(Lua L, long n)
      Creates a number Lua value from a long.
      Parameters:
      L - the Lua state
      n - the number value
      Returns:
      a number Lua value
    • STRING

      public static LuaValue STRING(Lua L, String s)
      Creates a string Lua value.
      Parameters:
      L - the Lua state
      s - the string value
      Returns:
      a string Lua value
    • BUFFER

      public static LuaValue BUFFER(Lua L, ByteBuffer buffer)
      Creates a buffer/raw string Lua value.
      Parameters:
      L - the Lua state
      buffer - the byte buffer
      Returns:
      a buffer Lua value