public boolean getBoolean(String key, boolean def) { String v = getStr(key, null); return v == null ? def : Boolean.parseBoolean(v); }
/** * Get a required field. If missing it adds to the errors */ public String getStr(String key) { if (ROOT_OBJ.equals(key)) { Object obj = getRootPrimitive(); if (obj == null) { errors.add(StrUtils.formatString(REQD, name)); } return obj == null ? null : String.valueOf(obj); } String s = getStr(key, null); if (s == null) errors.add(StrUtils.formatString(REQD, key)); return s; }