1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00

'v3.8.2.1'

This commit is contained in:
gnosygnu
2016-08-07 21:36:50 -04:00
parent b0fdf78a41
commit e4a2af026b
165 changed files with 2534 additions and 1247 deletions

View File

@@ -36,6 +36,10 @@ public class Json_nde extends Json_itm_base implements Json_grp {
Json_itm rv = Get_as_itm_or_null(key); if (rv == null) throw Err_.new_("json", "key missing", "key", key);
return Json_ary.cast(rv);
}
public byte[] Get_as_bry(String key) {
byte[] rv = Get_as_bry_or(Bry_.new_u8(key), null); if (rv == null) throw Err_.new_("json", "key missing", "key", key);
return rv;
}
public byte[] Get_as_bry_or(byte[] key, byte[] or) {
Json_itm rv = Get_as_itm_or_null(key);
return rv == null ? or : rv.Data_bry();
@@ -72,6 +76,10 @@ public class Json_nde extends Json_itm_base implements Json_grp {
byte[] rv = Get_as_bry_or(key, null);
return rv == null ? or : Bry_.Eq(rv, Bool_.True_bry);
}
public DateAdp Get_as_date_by_utc(String key) {
byte[] rv = Get_as_bry_or(Bry_.new_u8(key), null); if (rv == null) throw Err_.new_("json", "key missing", "key", key);
return DateAdp_.parse_gplx(String_.new_u8(rv));
}
// to convert
public boolean Has(byte[] key) {return Get_bry(key, null) != null;}