Ejemplo n.º 1
0
 public boolean ReadYn_toggle(String k, boolean cur) {
   Object rv = ReadOr(k, "!");
   if (rv == Nil) ThrowNotFound(k);
   if (!parse) throw Err_.new_wo_type("only parse supported");
   String rv_str = (String) rv;
   return (String_.Eq(rv_str, "!")) ? !cur : Yn.parse(rv_str);
 }
Ejemplo n.º 2
0
 public static GfoMsg root_leafArgs_(String[] ary, Keyval... kvAry) {
   int len = Array_.Len(ary);
   if (len == 0) throw Err_.new_invalid_arg("== 0", "@len", len);
   GfoMsg root = new GfoMsg_base().ctor_(ary[0], false);
   GfoMsg owner = root;
   for (int i = 1; i < len; i++) {
     String key = ary[i];
     GfoMsg cur = new GfoMsg_base().ctor_(key, false);
     owner.Subs_add(cur);
     owner = cur;
   }
   for (int i = 0; i < kvAry.length; i++) {
     Keyval kv = kvAry[i];
     owner.Add(kv.Key(), kv.Val());
   }
   return root;
 }
Ejemplo n.º 3
0
 void ThrowNotFound(String k) {
   throw Err_.new_wo_type("arg not found in msg", "k", k, "counter", counter, "args", args);
 }