public static boolean isNotEmpty(String... strs) { if (strs != null) { for (String s : strs) { if (isEmpty(s)) { return false; } } return true; } return false; }
public String getParam(String key, String defaultValue) { if (params != null) { String value = params.get(key); if (StringUtils.isEmpty(value)) { return defaultValue; } return value; } return null; }
public static void validateClusterName(String clusterName) { if (StringUtils.isEmpty(clusterName)) { throw new IllegalArgumentException("clusterName should not be null"); } if (clusterName.length() > 64) { throw new IllegalArgumentException("clusterName length should not great than 64"); } }
public static void validateNodeGroup(String nodeGroup) { if (StringUtils.isEmpty(nodeGroup)) { throw new IllegalArgumentException("nodeGroup should not be null"); } if (nodeGroup.length() > 64) { throw new IllegalArgumentException("nodeGroup length should not great than 64"); } }
public static OrderByType convert(String value) { if (StringUtils.isEmpty(value)) { return null; } return OrderByType.valueOf(value); }
public SelectSql andOnNotEmpty(String condition, String value) { if (StringUtils.isEmpty(value)) { return this; } return and(condition, value); }
public static NodeType convert(String value) { if (StringUtils.isEmpty(value)) { return null; } return NodeType.valueOf(value); } }
public DeleteSql andOnNotEmpty(String condition, String value) { if (StringUtils.isEmpty(value)) { return this; } return and(condition, value); }
public DeleteSql orOnNotEmpty(String condition, String value) { if (StringUtils.isEmpty(value)) { return this; } return or(condition, value); }
public WhereSql andOnNotEmpty(String condition, String value) { if (StringUtils.isEmpty(value)) { return this; } return and(condition, value); }
public WhereSql orOnNotEmpty(String condition, String value) { if (StringUtils.isEmpty(value)) { return this; } return or(condition, value); }
public static NodeType convert(String value) { if (StringUtils.isEmpty(value)) { return null; } return NodeType.valueOf(value); } }
public DeleteSql andOnNotEmpty(String condition, String value) { if (StringUtils.isEmpty(value)) { return this; } return and(condition, value); }
@Override public void load(String taskTrackerNodeGroup) { if (StringUtils.isEmpty(taskTrackerNodeGroup)) { for (String key : JOB_MAP.keySet()) { LOAD_SIGNAL.add(FORCE_PREFIX + key); } return; } LOAD_SIGNAL.add(FORCE_PREFIX + taskTrackerNodeGroup); }
/** * 显示设置绑定ip */ public void setBindIp(String bindIp) { if (StringUtils.isEmpty(bindIp) || !NetUtils.isValidHost(bindIp) ) { throw new IllegalArgumentException("Invalided bind ip:" + bindIp); } config.setIp(bindIp); }
/** * 显示设置绑定ip */ public void setBindIp(String bindIp) { if (StringUtils.isEmpty(bindIp) || !NetUtils.isValidHost(bindIp) ) { throw new IllegalArgumentException("Invalided bind ip:" + bindIp); } config.setIp(bindIp); }
public static final <T> T parse(String json, Type type) { try { if (StringUtils.isEmpty(json)) { return null; } return adapter.parse(json, type); } catch (Exception e) { throw new JSONException(e); } }
public static final <T> T parse(String json, Type type) { try { if (StringUtils.isEmpty(json)) { return null; } return adapter.parse(json, type); } catch (Exception e) { throw new JSONException(e); } }
public static <T> T load(Class<T> clazz, Config config) { ServiceProvider serviceProvider = getServiceProvider(clazz); String dynamicServiceName = config.getParameter(serviceProvider.dynamicConfigKey); String identity = config.getIdentity(); if(StringUtils.isEmpty(identity)){ throw new IllegalArgumentException("config.identity should not be null"); } return load(clazz, dynamicServiceName, identity); }
public static final <T> T parse(String json, TypeReference<T> typeReference) { try { if(StringUtils.isEmpty(json)){ return null; } return adapter.parse(json, typeReference.getType()); } catch (Exception e) { throw new JSONException(e); } }