ValueStyler that converts objects to String form — generally for
debugging purposes — using simple styling conventions that mimic the
toString() styling conventions for standard JDK implementations of
collections, maps, and arrays.
Uses the reflective visitor pattern underneath the hood to nicely encapsulate styling algorithms for each type of styled object.
Favor SimpleValueStyler over DefaultValueStyler when you
wish to use styling similar to the JDK or when you need configurable control
over the styling of classes and methods.
| Modifier and Type | Field and Description |
|---|---|
| private final Function | |
| public static final Function | DEFAULT_CLASS_STYLER
Default |
| public static final Function | DEFAULT_METHOD_STYLER
Default |
| private final Function |
| Access | Constructor and Description |
|---|---|
| public | SimpleValueStyler()
Create a |
| public |
| classStyler | back to summary |
|---|---|
| private final Function<Class<?>, String> classStyler | |
| DEFAULT_CLASS_STYLER | back to summary |
|---|---|
| public static final Function<Class<?>, String> DEFAULT_CLASS_STYLER Default | |
| DEFAULT_METHOD_STYLER | back to summary |
|---|---|
| public static final Function<Method, String> DEFAULT_METHOD_STYLER Default For example, if the supplied method is a reference to
| |
| methodStyler | back to summary |
|---|---|
| private final Function<Method, String> methodStyler | |
| SimpleValueStyler | back to summary |
|---|---|
| public SimpleValueStyler() Create a | |
| SimpleValueStyler | back to summary |
|---|---|
| public SimpleValueStyler(Function<Class<?>, String> classStyler, Function<Method, String> methodStyler) Create a | |
| styleArray | back to summary |
|---|---|
| protected String styleArray(Object[] array) Overrides org. Doc from org. Generate a styled version of the supplied array. | |
| styleClass | back to summary |
|---|---|
| protected String styleClass(Class<?> clazz) Overrides org. Doc from org. Generate a styled version of the supplied The default implementation delegates to | |
| styleCollection | back to summary |
|---|---|
| protected String styleCollection(Collection<?> collection) Overrides org. Doc from org. Generate a styled version of the supplied | |
| styleMap | back to summary |
|---|---|
| protected <K, V> String styleMap(Map<K, V> map) Overrides org. Doc from org. Generate a styled version of the supplied | |
| styleMethod | back to summary |
|---|---|
| protected String styleMethod(Method method) Overrides org. Doc from org. Generate a styled version of the supplied The default implementation returns the method's name and the short name of the
method's declaring class, separated by
the | |
| styleNull | back to summary |
|---|---|
| protected String styleNull() Overrides org. Doc from org. Generate a styled version of The default implementation returns | |
| styleString | back to summary |
|---|---|
| protected String styleString(String str) Overrides org. Doc from org. Generate a styled version of the supplied The default implementation returns the supplied string wrapped in single quotes. | |
| toSimpleMethodSignature | back to summary |
|---|---|
| private static String toSimpleMethodSignature(Method method) | |