From: James Moger Date: Fri, 28 Feb 2014 19:16:45 +0000 (-0500) Subject: Added join methods to array utils X-Git-Tag: v1.4.0~88 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=ede548778735ffa64fd2321fa8fcbe58746e4b09;p=gitblit.git Added join methods to array utils --- 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 List join(List... elements) { + List list = new ArrayList(); + for (List element : elements) { + list.addAll(element); + } + return list; + } + + public static List join(X[]... elements) { + List list = new ArrayList(); + for (X[] element : elements) { + list.addAll(Arrays.asList(element)); + } + return list; + } }