Package org.jboss.logging.processor.util
Class Objects.ToStringBuilder
- java.lang.Object
-
- org.jboss.logging.processor.util.Objects.ToStringBuilder
-
- Enclosing class:
- Objects
public static class Objects.ToStringBuilder extends java.lang.Object
A builder to build a defaultObject#toString()
value. Not thread safe.
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
className
private java.util.List<java.lang.String>
fieldValue
-
Constructor Summary
Constructors Modifier Constructor Description private
ToStringBuilder(java.lang.String className)
Private constructor for builder pattern.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description Objects.ToStringBuilder
add(java.lang.Object value)
Objects.ToStringBuilder
add(java.lang.String field, java.lang.Object value)
Adds the field and value to the value returned.static Objects.ToStringBuilder
of(java.lang.Class<?> clazz)
Creates a new string builder for theclazz
.static Objects.ToStringBuilder
of(java.lang.Object self)
Creates a new string builder for theself
.static Objects.ToStringBuilder
of(java.lang.String className)
Creates a new string builder for theclassName
.java.lang.String
toString()
-
-
-
Method Detail
-
of
public static Objects.ToStringBuilder of(java.lang.Class<?> clazz)
Creates a new string builder for theclazz
.- Parameters:
clazz
- the base class for the string result.- Returns:
- the current builder.
-
of
public static Objects.ToStringBuilder of(java.lang.String className)
Creates a new string builder for theclassName
.- Parameters:
className
- the class name to prepend the string value with.- Returns:
- the current builder.
-
of
public static Objects.ToStringBuilder of(java.lang.Object self)
Creates a new string builder for theself
.- Parameters:
self
- the object to create the builder for.- Returns:
- the current builder.
-
add
public Objects.ToStringBuilder add(java.lang.Object value)
-
add
public Objects.ToStringBuilder add(java.lang.String field, java.lang.Object value)
Adds the field and value to the value returned.- Parameters:
field
- the field for the value.value
- the value of the field.- Returns:
- the current instance of the builder.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-