public class VerboseTextBuilder extends Object
VerboseTextBuilder
us a utility-builder for creating human
readable String
objects from arrays, collections or maps (instead of
solely printing out the object references of those collections). The arrays,
collections or maps may be nested in any way still producing accordingly
indented and parenthesized text down to the single elements in those
collections whose Object.toString()
method is invoked . This
utility-builder is very useful when printing debug or error logs or
inspecting such the like data structures "on the fly".Modifier and Type | Field | Description |
---|---|---|
static char |
DEFAULT_COLLECTION_HEAD |
|
static char |
DEFAULT_COLLECTION_TAIL |
Constructor | Description |
---|---|
VerboseTextBuilder() |
Modifier and Type | Method | Description |
---|---|---|
static String |
asString(boolean[] aElements) |
This method represents a shortcut for the instance method
toString(boolean[]) though with public settings. |
static String |
asString(byte[] aElements) |
This method represents a shortcut for the instance method
toString(byte[]) though with public settings. |
static String |
asString(char[] aElements) |
This method represents a shortcut for the instance method
toString(char[]) though with public settings. |
static String |
asString(double[] aElements) |
This method represents a shortcut for the instance method
toString(double[]) though with public settings. |
static String |
asString(float[] aElements) |
This method represents a shortcut for the instance method
toString(float[]) though with public settings. |
static String |
asString(int[] aElements) |
This method represents a shortcut for the instance method
toString(int[]) though with public settings. |
static String |
asString(long[] aElements) |
This method represents a shortcut for the instance method
toString(long[]) though with public settings. |
static String |
asString(short[] aElements) |
This method represents a shortcut for the instance method
toString(short[]) though with public settings. |
static String |
asString(Boolean[] aElements) |
This method represents a shortcut for the instance method
toString(Boolean[]) though with public settings. |
static String |
asString(Byte[] aElements) |
This method represents a shortcut for the instance method
toString(Byte[]) though with public settings. |
static String |
asString(Character[] aElements) |
This method represents a shortcut for the instance method
toString(Character[]) though with public settings. |
static String |
asString(Double[] aElements) |
This method represents a shortcut for the instance method
toString(Double[]) though with public settings. |
static String |
asString(Float[] aElements) |
This method represents a shortcut for the instance method
toString(Float[]) though with public settings. |
static String |
asString(Integer[] aElements) |
This method represents a shortcut for the instance method
toString(Integer[]) though with public settings. |
static String |
asString(Long[] aElements) |
This method represents a shortcut for the instance method
toString(Long[]) though with public settings. |
static String |
asString(Object aElements) |
This method represents a shortcut for the instance method
toString(Boolean[]) though with public settings. |
static String |
asString(Object[] aElements) |
This method represents a shortcut for the instance method
toString(Boolean[]) though with public settings. |
static String |
asString(Short[] aElements) |
This method represents a shortcut for the instance method
toString(Short[]) though with public settings. |
static String |
asString(String[] aElements) |
This method represents a shortcut for the instance method
toString(String[]) though with public settings. |
static String |
asString(Collection<?> aElements) |
This method represents a shortcut for the instance method
toString(Boolean[]) though with public settings. |
static String |
asString(Map<?,?> aElements) |
This method represents a shortcut for the instance method
toString(Boolean[]) though with public settings. |
protected static String |
asVerboseString(Character aCollectionHead,
Collection<?> aCollection,
Character aCollectionTail) |
To verbose string.
|
protected static String |
asVerboseString(Character aCollectionHead,
Map<?,?> aMap,
Character aCollectionTail) |
To verbose string.
|
Character |
getCollectionHead() |
Gets the
String to be used for the begin of a collection. |
Character |
getCollectionTail() |
gets the
String to be used for the begin of a collection. |
Object[] |
getElements() |
Gets the elements for the elements property.
|
void |
setCollectionHead(Character aHead) |
Sets the
String to be used for the begin of a collection. |
void |
setCollectionTail(Character aTail) |
Sets the
String to be used for the begin of a collection. |
void |
setElements(boolean[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(byte[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(char[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(double[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(float[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(int[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(long[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(short[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(Boolean[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(Byte[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(Character[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(Double[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(Float[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(Integer[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(Long[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(Object aElements) |
Sets the elements for the elements property.
|
void |
setElements(Object[] aElements) |
Sets the elements for the elements property.
|
void |
setElements(Short[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(String[] aElements) |
Sets the CSV elements for the CSV elements property.
|
void |
setElements(Collection<?> aElements) |
Sets the elements.
|
void |
setElements(Map<?,?> aElements) |
Sets the elements for the elements property.
|
String |
toString() |
The
String being build by the builder upon the settings of the
attributes. |
String |
toString(boolean[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(byte[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(char[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(double[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(float[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(int[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(long[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(short[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(Boolean[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(Byte[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(Character[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(Double[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(Float[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(Integer[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(Long[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(Object aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(Object[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(Short[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(String[] aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(Collection<?> aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
String |
toString(Map<?,?> aElements) |
The
String being build by the builder upon the settings of the
attributes and the provided argument. |
VerboseTextBuilder |
withCollectionHead(Character aHead) |
Sets the
String to be used for the begin of a collection. |
VerboseTextBuilder |
withElements(boolean[] aElements) |
Sets the CSV elements for the CSV elements property.
|
VerboseTextBuilder |
withElements(byte[] aElements) |
Sets the CSV elements for the CSV elements property.
|
VerboseTextBuilder |
withElements(char[] aElements) |
Sets the CSV elements for the CSV elements property.
|
VerboseTextBuilder |
withElements(double[] aElements) |
Sets the CSV elements for the CSV elements property.
|
VerboseTextBuilder |
withElements(float[] aElements) |
Sets the CSV elements for the CSV elements property.
|
VerboseTextBuilder |
withElements(int[] aElements) |
Sets the CSV elements for the CSV elements property.
|
VerboseTextBuilder |
withElements(long[] aElements) |
Sets the CSV elements for the CSV elements property.
|
VerboseTextBuilder |
withElements(short[] aElements) |
Sets the CSV elements for the CSV elements property.
|
VerboseTextBuilder |
withElements(Object aElements) |
Sets the elements for the elements property.
|
VerboseTextBuilder |
withElements(Object[] aElements) |
Sets the elements for the elements property.
|
VerboseTextBuilder |
withElements(Collection<?> aElements) |
Sets the elements for the elements property.
|
VerboseTextBuilder |
withElements(Map<?,?> aElements) |
Sets the elements for the elements property.
|
public static final char DEFAULT_COLLECTION_HEAD
public static final char DEFAULT_COLLECTION_TAIL
public void setCollectionHead(Character aHead)
String
to be used for the begin of a collection.aHead
- The begin of a collection.public Character getCollectionHead()
String
to be used for the begin of a collection.public void setCollectionTail(Character aTail)
String
to be used for the begin of a collection.aTail
- The begin of a collection.public Character getCollectionTail()
String
to be used for the begin of a collection.public Object[] getElements()
public void setElements(Object[] aElements)
aElements
- The elements to be stored by the elements property.public void setElements(Collection<?> aElements)
aElements
- the new elementspublic void setElements(Map<?,?> aElements)
aElements
- The elements to be stored by the elements property.public void setElements(boolean[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public void setElements(byte[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public void setElements(short[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public void setElements(int[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public void setElements(long[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public void setElements(float[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public void setElements(double[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public void setElements(char[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public VerboseTextBuilder withElements(boolean[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public VerboseTextBuilder withElements(byte[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public VerboseTextBuilder withElements(short[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public VerboseTextBuilder withElements(int[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public VerboseTextBuilder withElements(long[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public VerboseTextBuilder withElements(float[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public VerboseTextBuilder withElements(double[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public VerboseTextBuilder withElements(char[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public void setElements(Boolean[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public void setElements(Byte[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public void setElements(Short[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public void setElements(Integer[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public void setElements(Long[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public void setElements(Float[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public void setElements(Double[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public void setElements(Character[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public void setElements(String[] aElements)
aElements
- The CSV elements to be stored by the CSV elements
property.public VerboseTextBuilder withElements(Object[] aElements)
aElements
- The elements to be stored by the elements property.public VerboseTextBuilder withElements(Collection<?> aElements)
aElements
- The elements to be stored by the elements property.public void setElements(Object aElements)
aElements
- The elements to be stored by the elements property.public VerboseTextBuilder withElements(Object aElements)
aElements
- The elements to be stored by the elements property.public VerboseTextBuilder withElements(Map<?,?> aElements)
aElements
- The elements to be stored by the elements property.public String toString()
String
being build by the builder upon the settings of the
attributes.public String toString(boolean[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(byte[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(short[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(int[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(long[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(float[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(double[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(char[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(Boolean[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(Byte[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(Short[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(Integer[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(Long[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(Float[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(Double[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(Character[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(String[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(Object[] aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(Collection<?> aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public String toString(Map<?,?> aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public VerboseTextBuilder withCollectionHead(Character aHead)
String
to be used for the begin of a collection.aHead
- The begin of a collection.public String toString(Object aElements)
String
being build by the builder upon the settings of the
attributes and the provided argument. This method is to be side effect
free in terms of the elements (and the verbose result) are not part of
the state for this instance (from the point of view of this method).
Still changing for example the elements via
withElements(Collection)
can cause side effects! For avoiding
thread race conditions / side effects regarding the elements text (and
the verbose result), use this method instead of the combination of
withElements(Collection)
with toString()
.public static String asString(boolean[] aElements)
toString(boolean[])
though with public settings.public static String asString(byte[] aElements)
toString(byte[])
though with public settings.public static String asString(short[] aElements)
toString(short[])
though with public settings.public static String asString(int[] aElements)
toString(int[])
though with public settings.public static String asString(long[] aElements)
toString(long[])
though with public settings.public static String asString(float[] aElements)
toString(float[])
though with public settings.public static String asString(double[] aElements)
toString(double[])
though with public settings.public static String asString(char[] aElements)
toString(char[])
though with public settings.public static String asString(Boolean[] aElements)
toString(Boolean[])
though with public settings.public static String asString(Byte[] aElements)
toString(Byte[])
though with public settings.public static String asString(Short[] aElements)
toString(Short[])
though with public settings.public static String asString(Integer[] aElements)
toString(Integer[])
though with public settings.public static String asString(Long[] aElements)
toString(Long[])
though with public settings.public static String asString(Float[] aElements)
toString(Float[])
though with public settings.public static String asString(Double[] aElements)
toString(Double[])
though with public settings.public static String asString(Character[] aElements)
toString(Character[])
though with public settings.public static String asString(String[] aElements)
toString(String[])
though with public settings.public static String asString(Object[] aElements)
toString(Boolean[])
though with public settings.public static String asString(Collection<?> aElements)
toString(Boolean[])
though with public settings.public static String asString(Map<?,?> aElements)
toString(Boolean[])
though with public settings.public static String asString(Object aElements)
toString(Boolean[])
though with public settings.protected static String asVerboseString(Character aCollectionHead, Collection<?> aCollection, Character aCollectionTail)
aCollectionHead
- The head sequence for the collection.aCollection
- the collectionaCollectionTail
- The tail sequence for the collection.protected static String asVerboseString(Character aCollectionHead, Map<?,?> aMap, Character aCollectionTail)
aCollectionHead
- The head sequence for the collection.aMap
- the mapaCollectionTail
- The tail sequence for the collection.Copyright © 2021. All rights reserved.