diff options
author | James Moger <james.moger@gitblit.com> | 2014-02-28 14:16:45 -0500 |
---|---|---|
committer | James Moger <james.moger@gitblit.com> | 2014-03-01 09:20:23 -0500 |
commit | ede548778735ffa64fd2321fa8fcbe58746e4b09 (patch) | |
tree | e274c12b0183791848e48fc22865ae6bc6ba91cf /src | |
parent | 0b953c80b3fb43a4fcd559591067e719ec346d44 (diff) | |
download | gitblit-ede548778735ffa64fd2321fa8fcbe58746e4b09.tar.gz gitblit-ede548778735ffa64fd2321fa8fcbe58746e4b09.zip |
Added join methods to array utils
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/gitblit/utils/ArrayUtils.java | 17 |
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;
+ }
}
|