sockeqwe / ParcelablePlease

Annotation Processor for generating Parcelable code
http://hannesdorfmann.com/android/ParcelablePlease
Apache License 2.0
259 stars 21 forks source link

Suggestion for API change to remove more boilerplate #11

Open mg6maciej opened 9 years ago

mg6maciej commented 9 years ago

I like that you don't have a subclass like in Parceler and other similar libraries.

How about changing the code you have to write to something like code below?

@ParcelablePlease
public class Model implements Parcelable {

  int id;
  String name;
  OtherModel otherModel;

  @Override public int describeContents() {
    return 0;
  }

  @Override public void writeToParcel(Parcel dest, int flags) {
    ModelParcelablePlease.writeToParcel(this, dest, flags);
  }

  public static final Creator<Model> CREATOR = ModelParcelablePlease.creator();
}
sockeqwe commented 9 years ago

good idea!