From ede548778735ffa64fd2321fa8fcbe58746e4b09 Mon Sep 17 00:00:00 2001 From: James Moger Date: Fri, 28 Feb 2014 14:16:45 -0500 Subject: [PATCH] Added join methods to array utils --- src/main/java/com/gitblit/utils/ArrayUtils.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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; + } } -- 2.39.5