Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
0022590c
Commit
0022590c
authored
Mar 10, 2022
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
下载视频
parent
b5a4e2b8
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
4 deletions
+16
-4
ArrayHelper.java
...rc/main/java/com/yanzuoguang/util/helper/ArrayHelper.java
+16
-4
No files found.
yzg-util-base/src/main/java/com/yanzuoguang/util/helper/ArrayHelper.java
View file @
0022590c
...
@@ -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
)
{
for
(
T
item
:
list
)
{
if
(!
StringHelper
.
isEmpty
(
item
))
{
if
(!
StringHelper
.
isEmpty
(
item
))
{
tos
.
add
(
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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment