public class ArrayAndCollectionFormatter extends Object
| Modifier and Type | Field and Description |
|---|---|
protected int |
maxNrOfElements |
protected ObjectFormatter |
objectFormatter |
| Constructor and Description |
|---|
ArrayAndCollectionFormatter(int maxNrOfElements,
ObjectFormatter objectFormatter)
Creates a formatter with the given maximum nr of elements.
|
| Modifier and Type | Method and Description |
|---|---|
void |
formatArray(Object array,
int currentDepth,
StringBuilder result)
Formats the given array.
|
protected void |
formatBooleanArray(boolean[] array,
StringBuilder result) |
protected void |
formatByteArray(byte[] array,
StringBuilder result) |
protected void |
formatCharArray(char[] array,
StringBuilder result) |
void |
formatCollection(Collection<?> collection,
int currentDepth,
StringBuilder result)
Formats the given collection.
|
protected void |
formatDoubleArray(double[] array,
StringBuilder result) |
protected void |
formatFloatArray(float[] array,
StringBuilder result) |
protected void |
formatIntArray(int[] array,
StringBuilder result) |
protected void |
formatLongArray(long[] array,
StringBuilder result) |
void |
formatMap(Map<?,?> map,
int currentDepth,
StringBuilder result)
Formats the given map.
|
protected void |
formatObjectArray(Object[] array,
int currentDepth,
StringBuilder result) |
protected void |
formatShortArray(short[] array,
StringBuilder result) |
protected int maxNrOfElements
protected ObjectFormatter objectFormatter
public ArrayAndCollectionFormatter(int maxNrOfElements,
ObjectFormatter objectFormatter)
maxNrOfElements - The maximum nr of elements for arrays and collections to display > 0objectFormatter - The object formatter that uses this array/collection formatter, not nullpublic void formatArray(Object array, int currentDepth, StringBuilder result)
array - The array, not nullcurrentDepth - The current recursion depthresult - The builder to append the result to, not nullpublic void formatCollection(Collection<?> collection, int currentDepth, StringBuilder result)
collection - The collection, not nullcurrentDepth - The current recursion depthresult - The builder to append the result to, not nullpublic void formatMap(Map<?,?> map, int currentDepth, StringBuilder result)
map - The map, not nullcurrentDepth - The current recursion depthresult - The builder to append the result to, not nullprotected void formatObjectArray(Object[] array, int currentDepth, StringBuilder result)
protected void formatByteArray(byte[] array,
StringBuilder result)
protected void formatShortArray(short[] array,
StringBuilder result)
protected void formatIntArray(int[] array,
StringBuilder result)
protected void formatLongArray(long[] array,
StringBuilder result)
protected void formatCharArray(char[] array,
StringBuilder result)
protected void formatFloatArray(float[] array,
StringBuilder result)
protected void formatDoubleArray(double[] array,
StringBuilder result)
protected void formatBooleanArray(boolean[] array,
StringBuilder result)
Copyright © 2016. All Rights Reserved.