public static Object parseValue(String value) { Object ret; if (VerifyUtils.isInteger(value)) { ret = Integer.parseInt(value); } else if (VerifyUtils.isLong(value)) { ret = Long.parseLong(value); } else if (VerifyUtils.isDouble(value)) { ret = Double.parseDouble(value); } else if (VerifyUtils.isFloat(value)) { ret = Float.parseFloat(value); } else { ret = value; } return ret; }
public static boolean isEmpty(String str) { return !isNotEmpty(str); } }
if (VerifyUtils.isNotEmpty(cookie.getComment())) { sb.append(";Comment=").append(cookie.getComment()); if (VerifyUtils.isNotEmpty(cookie.getDomain())) { sb.append(";Domain=").append(cookie.getDomain()); String path = VerifyUtils.isEmpty(cookie.getPath()) ? "/" : cookie.getPath(); sb.append(";Path=").append(path);
public SafeSimpleDateFormat(String datePattern) { final String p = VerifyUtils.isEmpty(datePattern) ? "yyyy-MM-dd HH:mm:ss" : datePattern; this.threadLocal = new ThreadLocal<SimpleDateFormat>() { protected SimpleDateFormat initialValue() { return new SimpleDateFormat(p); } }; }
if (VerifyUtils.isNotEmpty(cookie.getComment())) { sb.append(";Comment=").append(cookie.getComment()); if (VerifyUtils.isNotEmpty(cookie.getDomain())) { sb.append(";Domain=").append(cookie.getDomain()); String path = VerifyUtils.isEmpty(cookie.getPath()) ? "/" : cookie.getPath(); sb.append(";Path=").append(path);
@Override public void add(LogItem logItem) { if (!start) return; if (VerifyUtils.isEmpty(logItem.getName())) throw new IllegalArgumentException("log name is empty"); queue.offer(logItem); }
public static Object parseValue(String value) { Object ret; if (VerifyUtils.isInteger(value)) { ret = Integer.parseInt(value); } else if (VerifyUtils.isLong(value)) { ret = Long.parseLong(value); } else if (VerifyUtils.isDouble(value)) { ret = Double.parseDouble(value); } else if (VerifyUtils.isFloat(value)) { ret = Float.parseFloat(value); } else { ret = value; } return ret; }
public static String generateSetCookie(Cookie cookie) { if (cookie == null) { throw new IllegalArgumentException("the cookie is null"); } else { StringBuilder sb = new StringBuilder(); sb.append(cookie.getName()).append('=').append(cookie.getValue()); if (VerifyUtils.isNotEmpty(cookie.getComment())) { sb.append(";Comment=").append(cookie.getComment()); } if (VerifyUtils.isNotEmpty(cookie.getDomain())) { sb.append(";Domain=").append(cookie.getDomain()); } if (cookie.getMaxAge() >= 0) { sb.append(";Max-Age=").append(cookie.getMaxAge()); } String path = VerifyUtils.isEmpty(cookie.getPath()) ? "/" : cookie.getPath(); sb.append(";Path=").append(path); if (cookie.getSecure()) { sb.append(";Secure"); } sb.append(";Version=").append(cookie.getVersion()); return sb.toString(); } }
@Override public void add(LogItem logItem) { if (!start) return; if (VerifyUtils.isEmpty(logItem.getName())) throw new IllegalArgumentException("log name is empty"); queue.offer(logItem); } }
public static boolean isEmpty(String str) { return !isNotEmpty(str); } }
@SuppressWarnings("unchecked") public static <T> T convert(String value, String argsType) { Object ret = null; ParseValue p = argsType == null ? null : map2.get(argsType); if (p != null) ret = p.parse(value); else { if (VerifyUtils.isInteger(value)) { ret = Integer.parseInt(value); } else if (VerifyUtils.isLong(value)) { ret = Long.parseLong(value); } else if (VerifyUtils.isDouble(value)) { ret = Double.parseDouble(value); } else if (VerifyUtils.isFloat(value)) { ret = Float.parseFloat(value); } else { ret = value; } } return (T) ret; }
public static String generateSetCookie(Cookie cookie) { if (cookie == null) { throw new IllegalArgumentException("the cookie is null"); } else { StringBuilder sb = new StringBuilder(); sb.append(cookie.getName()).append('=').append(cookie.getValue()); if (VerifyUtils.isNotEmpty(cookie.getComment())) { sb.append(";Comment=").append(cookie.getComment()); } if (VerifyUtils.isNotEmpty(cookie.getDomain())) { sb.append(";Domain=").append(cookie.getDomain()); } if (cookie.getMaxAge() >= 0) { sb.append(";Max-Age=").append(cookie.getMaxAge()); } String path = VerifyUtils.isEmpty(cookie.getPath()) ? "/" : cookie.getPath(); sb.append(";Path=").append(path); if (cookie.getSecure()) { sb.append(";Secure"); } sb.append(";Version=").append(cookie.getVersion()); return sb.toString(); } }
public SafeSimpleDateFormat(String datePattern) { final String p = VerifyUtils.isEmpty(datePattern) ? "yyyy-MM-dd HH:mm:ss" : datePattern; this.threadLocal = ThreadLocal.withInitial(() -> new SimpleDateFormat(p)); }
public static boolean isEmpty(String o) { return !isNotEmpty(o); } }