/** Return argument i as a LuaString if a string or number, {@code defval} if nil, or throw a LuaError if any other type * @param i the index of the argument to test, 1 is the first argument * @return LuaString value if argument i is a string or number, or defval if not supplied or nil * @exception LuaError if the argument is not a string or number * */ public LuaString optstring(int i, LuaString defval) { return arg(i).optstring(defval); }
/** Return argument i as a LuaString if a string or number, {@code defval} if nil, or throw a LuaError if any other type * @param i the index of the argument to test, 1 is the first argument * @return LuaString value if argument i is a string or number, or defval if not supplied or nil * @exception LuaError if the argument is not a string or number * */ public LuaString optstring(int i, LuaString defval) { return arg(i).optstring(defval); }
/** Return argument i as a LuaString if a string or number, {@code defval} if nil, or throw a LuaError if any other type * @param i the index of the argument to test, 1 is the first argument * @return LuaString value if argument i is a string or number, or defval if not supplied or nil * @exception LuaError if the argument is not a string or number * */ public LuaString optstring(int i, LuaString defval) { return arg(i).optstring(defval); }
Message(LuaValue data) { useDB = data.get("useDB").optboolean(false); lang = data.get("lang").optjstring("en"); keys = data.get("keys").opttable(new LuaTable()); params = data.get("params").opttable(new LuaTable()); rawMessage = data.get("rawMessage").optstring(LuaString.valueOf("")); }