summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/com/gitblit/utils/ArrayUtils.java17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/com/gitblit/utils/ArrayUtils.java b/src/main/java/com/gitblit/utils/ArrayUtils.java
index 8387ef73..1402ad5e 100644
--- a/src/main/java/com/gitblit/utils/ArrayUtils.java
+++ b/src/main/java/com/gitblit/utils/ArrayUtils.java
@@ -16,6 +16,7 @@
package com.gitblit.utils;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.Collection;
import java.util.List;
@@ -71,4 +72,20 @@ public class ArrayUtils {
}
return list;
}
+
+ public static <X> List<X> join(List<X>... elements) {
+ List<X> list = new ArrayList<X>();
+ for (List<X> element : elements) {
+ list.addAll(element);
+ }
+ return list;
+ }
+
+ public static <X> List<X> join(X[]... elements) {
+ List<X> list = new ArrayList<X>();
+ for (X[] element : elements) {
+ list.addAll(Arrays.asList(element));
+ }
+ return list;
+ }
}