/** Return argument i as a java String 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 String 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 String optjstring(int i, String defval) { return arg(i).optjstring(defval); }
/** Return argument i as a java String 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 String 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 String optjstring(int i, String defval) { return arg(i).optjstring(defval); }
/** Return argument i as a java String 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 String 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 String optjstring(int i, String defval) { return arg(i).optjstring(defval); }
@Override public LuaValue call(LuaValue code, LuaValue inLanguage) { final String name = languages.getName(code.checkjstring(), inLanguage.optjstring(null)); return name == null ? NIL : toLuaString(name); } };
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("")); }