frankiesardo / auto-parcel
Category: Utils
Minimum SDK Level: None (1 | 1.0)


View in Github Github project information
Starred: 0
Forks: 0
Watchers: 0
Open Issues: 0

Snapshot pictures

No snapshot for this library yet.


AutoParcel is an AutoValue extension that enables Parcelable values generation.

Just add implements Parcelable to your @AutoValue annotated models.

abstract class Person implements Parcelable {
  abstract String name();
  abstract List<Address> addresses();
  abstract Map<Person, Integer> likes();

  static Person create(String name, List<Address> addresses, Map<Person, Integer> likes) {
    return new AutoValue_Person(name, addresses, likes);

That's that simple. And you get Parcelable, hashCode, equals and toString implementations for free.

As your models evolve you don't need to worry about keeping all the boilerplate in sync with the new implementation, it's already taken care of.


See also