title: Using Google Guava's Objects.ToStringHelper
body: <p>I used <code>ToStringBuilder.reflectionToString(class)</code> in commons-lang, to implement <code>toString()</code> for simple DTOs. Now I'm trying to use Google Guava instead of Apache commons library. And I found <code>Objects.ToStringHelper</code> in Guava. But it's too verbose if there're lots of members in the class. For example:</p>
  
  <pre><code>@Override
  public String toString() {
      return MoreObjects.toStringHelper(this.getClass()).add("name", name)
              .add("emailAddress", emailAddress)
              .add("department", department).add("yearJoined", yearJoined)
              .toString();
  }
  </code></pre>
  
  <p>is much simpler if I use commons-lang:</p>
  
  <pre><code>@Override
  public String toString() {
      return ToStringBuilder.reflectionToString(this);
  }
  </code></pre>
  
  <p>Is there any better ways to implement <code>toString()</code> with Guava, not with commons-lang?</p>
  
  <p><a href="https://google.github.io/guava/releases/snapshot/api/docs/com/google/common/base/MoreObjects.html" rel="noreferrer">Guava docs</a></p>