public class CustomLabelStringBuilder extends Object
CustomLabeled.getCustomLabel()
implementations.
You can customize the output using singleLine()
.
The builder will automatically handle cycles in the object tree. It also pretty prints arrays and Iterables.
The implementation and API is inspired byToStringBuilder
.Constructor and Description |
---|
CustomLabelStringBuilder(Object instance) |
Modifier and Type | Method and Description |
---|---|
CustomLabelStringBuilder |
add(String fieldName,
Object fieldValue) |
CustomLabelStringBuilder |
singleLine()
Fields are printed on a single line, separated by commas instead of newlines
|
String |
toString() |
public CustomLabelStringBuilder(Object instance)
instance
- the instance which's label should be builtpublic CustomLabelStringBuilder singleLine()
public CustomLabelStringBuilder add(String fieldName, Object fieldValue)
fieldName
- the field name to list the value underfieldValue
- the value to add to the outputCopyright © 2018–2021 b+m Informatik AG. All rights reserved.