rharter / auto-value-gson

AutoValue Extension to add Gson De/Serializer support
Apache License 2.0
607 stars 103 forks source link

Generate human readable helper toString() methods #231

Closed ZacSweers closed 4 years ago

ZacSweers commented 4 years ago

Useful for debugging to know what kind of adapter you're using. Adopted from Moshi with a similar StringBuilder approach to reduce string pool bloating

Example:

@Override
public String toString() {
  return new StringBuilder().append("TypeAdapter(").append("GenerateTypeAdapterTest.Taco").append(")").toString();
}
ZacSweers commented 4 years ago

Need to update tests, but will wait for review of the implementation first before doing so

ZacSweers commented 4 years ago

Eh just went ahead and updated the tests