@Test public void splitIdsByLong() { String idStr = "1,2,3,4"; Long[] ids = CommonUtil.splitIdsByLong(idStr, GlobalConstants.SPLITOR); Assert.equals(ids[2], NUM_3L, ErrorCodeDef.SYSTEM_ERROR_10001); System.out.println("将逗号分割的数字转化为long[]"); }
public static Long[] splitIdsByLong(final String idStr, final String splitor) { Long[] ids = null; if (StringUtils.isNotEmpty(idStr)) { String[] strs = StringUtils.split(idStr, splitor); ids = new Long[strs.length]; for (int i = 0; i < strs.length; i++) { ids[i] = Long.valueOf(strs[i]); } } return ids; }
CommonUtil { public static Long[] splitIdsByLong(final String idStr, final String splitor) { Long[] ids = null; if (StringUtils.isNotEmpty(idStr)) { String[] strs = StringUtils.split(idStr, splitor); ids = new Long[strs.length]; for (int i = 0; i < strs.length; i++) { ids[i] = Long.valueOf(strs[i]); } } return ids; } }
CommonUtil { public static Long[] splitIdsByLong(final String idStr, final String splitor) { Long[] ids = null; if (StringUtils.isNotEmpty(idStr)) { String[] strs = StringUtils.split(idStr, splitor); ids = new Long[strs.length]; for (int i = 0; i < strs.length; i++) { ids[i] = Long.valueOf(strs[i]); } } return ids; }  }
CommonUtil { public static Long[] splitIdsByLong(final String idStr, final String splitor) { Long[] ids = null; if (StringUtils.isNotEmpty(idStr)) { String[] strs = StringUtils.split(idStr, splitor); ids = new Long[strs.length]; for (int i = 0; i < strs.length; i++) { ids[i] = Long.valueOf(strs[i]); } } return ids; }  static String messageFormat(final String message, final Object... params); static String getTransactionID(); static String getRandomCode(); static String getRandomNumber(final int size); static String getRandomChar(final int size); static String getString(final Object obj); static String notNullStr(final String str); static Date getDate(final Long time); static Integer[] splitId(final String idStr, final String splitor); static Long[] splitIdsByLong(final String idStr, final String splitor); static Integer[] splitId(final String idStr); static boolean wildcardMatch(final Collection<String> rules, final String matchValue); static boolean wildcardMatch(final String rule, final String matchValue); static boolean match(final String rule, final String matchValue); static String removeAllSymbol(final String str); static String replaceAllBlank(final String str); static String replaceRedundantBlank(final String str); static boolean isNotEmpty(final T[] paramTypes); static boolean isEmpty(final T[] paramTypes); }
CommonUtil { public static Long[] splitIdsByLong(final String idStr, final String splitor) { Long[] ids = null; if (StringUtils.isNotEmpty(idStr)) { String[] strs = StringUtils.split(idStr, splitor); ids = new Long[strs.length]; for (int i = 0; i < strs.length; i++) { ids[i] = Long.valueOf(strs[i]); } } return ids; }  static String messageFormat(final String message, final Object... params); static String getTransactionID(); static String getRandomCode(); static String getRandomNumber(final int size); static String getRandomChar(final int size); static String getString(final Object obj); static String notNullStr(final String str); static Date getDate(final Long time); static Integer[] splitId(final String idStr, final String splitor); static Long[] splitIdsByLong(final String idStr, final String splitor); static Integer[] splitId(final String idStr); static boolean wildcardMatch(final Collection<String> rules, final String matchValue); static boolean wildcardMatch(final String rule, final String matchValue); static boolean match(final String rule, final String matchValue); static String removeAllSymbol(final String str); static String replaceAllBlank(final String str); static String replaceRedundantBlank(final String str); static boolean isNotEmpty(final T[] paramTypes); static boolean isEmpty(final T[] paramTypes);  }