net.ibao.dnscat.util

Class ArrayToString


public final class ArrayToString
extends java.lang.Object

Convenience method for producing a simple textual representation of an array.

The format of the returned String is the same as AbstractCollection.toString:

Authors:
Jerome Lacoste
www.javapractices.com

Field Summary

private static String
fEND_CHAR
private static String
fNULL
private static String
fSEPARATOR
private static String
fSTART_CHAR

Method Summary

private static void
checkObjectIsArray(Object aArray)
static String
get(Object aArray)
aArray is a possibly-null array whose elements are primitives or objects; arrays of arrays are also valid, in which case aArray is rendered in a nested, recursive fashion.
static String
get(Object aArray, int length)
private static boolean
isLastItem(int aIdx, int aLength)
private static boolean
isNonNullArray(Object aItem)

Field Details

fEND_CHAR

private static final String fEND_CHAR


fNULL

private static final String fNULL


fSEPARATOR

private static final String fSEPARATOR


fSTART_CHAR

private static final String fSTART_CHAR

Method Details

checkObjectIsArray

private static void checkObjectIsArray(Object aArray)


get

public static String get(Object aArray)
aArray is a possibly-null array whose elements are primitives or objects; arrays of arrays are also valid, in which case aArray is rendered in a nested, recursive fashion.


get

public static String get(Object aArray,
                         int length)


isLastItem

private static boolean isLastItem(int aIdx,
                                  int aLength)


isNonNullArray

private static boolean isNonNullArray(Object aItem)