Using Google Guava's Objects.ToStringHelper

前端 未结 6 526
生来不讨喜
生来不讨喜 2021-01-30 10:36

I used ToStringBuilder.reflectionToString(class) in commons-lang, to implement toString() for simple DTOs. Now I\'m trying to use Google Guava instead

6条回答
  •  情话喂你
    2021-01-30 11:08

    There is a plugin http://sourceforge.net/projects/guavaeclipse/ (really small one) which can generate toString methods (and equals hashcode as well) using Guava classes. This is a nice solution because generated methods are really small and do not clutter the class.

提交回复
热议问题