Using Google Guava's Objects.ToStringHelper

前端 未结 6 522
生来不讨喜
生来不讨喜 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:01

    It is worth noting that Objects.toStringHelper has been deprecated (to be removed completely in June 2016) in favor of MoreObjects.toStringHelper. I have copied the default Guava template in my Intellij IDE into a new one that uses the MoreObjects instead. Cheers.

    Guava docs

提交回复
热议问题