rharter / auto-value-gson

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

Generated TypeAdapterFactory is public #219

Closed dmitry-timofeev closed 5 years ago

dmitry-timofeev commented 5 years ago

The generated AutoValueGson_FooTypeAdapterFactory is public, although it seems that it must be package-private and only be used by FooTypeAdapterFactory#create.

Factory base class code:

@GsonTypeAdapterFactory
public abstract class FooTypeAdapterFactory implements TypeAdapterFactory {

  // If I understand correctly, the clients are suppossed to use this
  // public and documented method, and not have direct access to
  // the generated class. The readme confirms such expectation.
  public static TypeAdapterFactory create() {
    return new AutoValueGson_FooTypeAdapterFactory();
  }
}

AutoValueGson version: 1.0.0

ZacSweers commented 5 years ago

PR welcome!

ZacSweers commented 5 years ago

PR: #228