增加List打乱函数
This commit is contained in:
parent
c1c79c8683
commit
9caafb8f04
@ -1,5 +1,6 @@
|
||||
package org.spiderflow.core.executor.function.extension;
|
||||
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
@ -34,5 +35,12 @@ public class ListFunctionExtension implements FunctionExtension{
|
||||
public static String join(List<?> list,String separator){
|
||||
return StringUtils.join(list.toArray(),separator);
|
||||
}
|
||||
|
||||
@Comment("将list打乱顺序")
|
||||
@Example("${listVar.shuffle()}")
|
||||
public static List<?> shuffle(List<?> list){
|
||||
Collections.shuffle(list);
|
||||
return list;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user