public abstract class DataUtils extends Object
Modifier | Constructor and Description |
---|---|
protected |
DataUtils()
Default constructor that prevents creation of class.
|
Modifier and Type | Method and Description |
---|---|
static String |
format(Number number)
Returns a formatted string of the specified number.
|
static String |
format(Object obj)
Returns a formatted string of the specified object.
|
static String |
join(String separator,
double... elements)
Returns a string with all double values concatenated by a specified
separator.
|
static String |
join(String separator,
float... elements)
Returns a string with all float values concatenated by a specified
separator.
|
static String |
join(String separator,
List<?> elements)
Returns a string containing all elements concatenated by a specified
separator.
|
static String |
join(String separator,
Object... elements)
Returns a string containing all elements concatenated by a specified
separator.
|
static <K,V> Map<K,V> |
map(K[] keys,
V[] values)
Creates a mapping from two arrays, one with keys, one with values.
|
static int |
max(int... values)
Returns the largest of all specified values.
|
static void |
transfer(InputStream in,
OutputStream out,
int bufferSize)
Copies data from an input stream to an output stream using a buffer of
specified size.
|
protected DataUtils()
public static <K,V> Map<K,V> map(K[] keys, V[] values)
K
- Data type of the keys.V
- Data type of the values.keys
- Array containing the keys.values
- Array containing the values.public static String join(String separator, List<?> elements)
separator
- Separator string.elements
- List of elements that should be concatenated.public static String join(String separator, Object... elements)
separator
- Separator string.elements
- List of elements that should be concatenated.public static String join(String separator, float... elements)
separator
- Separator string.elements
- Float array.public static String join(String separator, double... elements)
separator
- Separator string.elements
- Double array.public static int max(int... values)
values
- Several integer values.public static void transfer(InputStream in, OutputStream out, int bufferSize) throws IOException
in
- Input stream.out
- Output stream.bufferSize
- Size of the copy buffer.IOException
- when an error occurs while copying.public static String format(Number number)
number
- Number to convert to a string.Copyright © 2010-2013. All Rights Reserved.