Open walec51 opened 5 years ago
How can we do the 3?
As much as I dislike boilerplate, the other options have downsides as well.
2) As funky as Lombok looks at times it does has its issues when JVM versions changes, it more a hack than anything. If anything embracing a different compiler like kotlin and it's data classes would not have that problem.
Do we relay need those
toString
boilercode for DTOs? For me their result is usually to long to use in debugging / logging so I end up using the debuggers UI to introspect the object anyway.Personally I'm in favor of only using
toString
when a short text representation makes sense.Like in
CurrencyPair
wheretoString
results in "BTC/USD".For more complex object where such a representation is not apparent we can do one of the following:
ObjectMapperHelper
intoString
to just serialize the object to JSON