Commit 0022590c authored by yanzg's avatar yanzg

下载视频

parent b5a4e2b8
...@@ -17,21 +17,33 @@ public class ArrayHelper { ...@@ -17,21 +17,33 @@ public class ArrayHelper {
* @param froms 参数列表 * @param froms 参数列表
* @return 第一个非空字符串 * @return 第一个非空字符串
*/ */
public static <T extends Object> List<T> megerNotEmpty(T from, List<T> froms) { public static <T extends Object> List<T> megerNotEmpty(T from, List<T>... froms) {
List<T> tos = new ArrayList<>(); List<T> tos = new ArrayList<>();
if (!StringHelper.isEmpty(from)) { if (!StringHelper.isEmpty(from)) {
tos.add(from); tos.add(from);
} }
if (froms != null) { if (froms != null) {
for (T item : froms) { for (List<T> list : froms) {
if (!StringHelper.isEmpty(item)) { for (T item : list) {
tos.add(item); if (!StringHelper.isEmpty(item)) {
tos.add(item);
}
} }
} }
} }
return tos; return tos;
} }
/**
* 获取第一个对象
*
* @param froms
* @param <T>
* @return
*/
public static <T extends Object> T getFirst(List<T> froms) {
return froms.size() > 0 ? froms.get(0) : null;
}
/** /**
* 判断对象是否是数组或者List * 判断对象是否是数组或者List
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment