to top
public class

ArrayUtil

extends Object
java.lang.Object
   ↳ com.android.tradefed.util.ArrayUtil

Class Overview

Utility methods for arrays

Summary

Public Methods
static String[] buildArray(String... arrays)
Build an array from the provided contents.
static String join(String sep, Object... pieces)
Turns a sequence of objects into a string, delimited by sep.
static <T> List<T> list(T... inputAry)
Convert a varargs list/array to an List.
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static String[] buildArray (String... arrays)

Build an array from the provided contents.

The resulting array will be the concatenation of arrays input arrays, in their original order.

Parameters
arrays the arrays to concatenate
Returns
  • the newly constructed array

public static String join (String sep, Object... pieces)

Turns a sequence of objects into a string, delimited by sep. If a single Collection is passed, it is assumed that the elements of that Collection are to be joined. Otherwise, wraps the passed Object(s) in a List and joins the generated list.

Parameters
sep the string separator to delimit the different output segments.
pieces A Collection or a varargs Array of objects.

public static List<T> list (T... inputAry)

Convert a varargs list/array to an List. This is useful for building instances of List by hand. Note that this differs from asList(T...) in that the returned array is mutable.

Parameters
inputAry an array, or a varargs list
Returns
  • a List instance with the identical contents