Commit 0022590c authored by yanzg's avatar yanzg

下载视频

parent b5a4e2b8
......@@ -17,21 +17,33 @@ public class ArrayHelper {
* @param froms 参数列表
* @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<>();
if (!StringHelper.isEmpty(from)) {
tos.add(from);
}
if (froms != null) {
for (T item : froms) {
if (!StringHelper.isEmpty(item)) {
tos.add(item);
for (List<T> list : froms) {
for (T item : list) {
if (!StringHelper.isEmpty(item)) {
tos.add(item);
}
}
}
}
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
......
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