| | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 判断 jsonObject 是否为空 |
| | | * @param jsonStr |
| | |
| | | */ |
| | | public static void hasKey(Map info,String key,String message){ |
| | | isNotNull(info,key,message); |
| | | } |
| | | |
| | | /** |
| | | * 判断 jsonObject 是否为空 |
| | | * @param info |
| | | * @param key |
| | | * @param message |
| | | */ |
| | | public static void hasKeyAndValue(Map info,String key,String message){ |
| | | isNotNull(info,key,message); |
| | | hasLength(info.get(key)== null?"":info.get(key).toString(),message); |
| | | } |
| | | |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 判断 jsonObject 是否为空 |
| | | * @param strValue |
| | | * @param message |
| | | */ |
| | | public static void isJsonObject(String strValue,String message){ |
| | | if(!isJsonObject(strValue)){ |
| | | throw new IllegalArgumentException(message); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 校验是否为JSON |
| | | * @param msg |
| | | * @return |
| | |
| | | throw new IllegalArgumentException(msg); |
| | | } |
| | | } |
| | | |
| | | public static void isDate(String text,String msg){ |
| | | try{ |
| | | DateUtil.getDefaultDateFromString(text); |
| | | }catch (Exception e){ |
| | | throw new IllegalArgumentException(msg); |
| | | } |
| | | } |
| | | } |