While PaperParcel 1.x and 2.x have very similar APIs, there has been a several breaking changes (including several APIs having been removed). This guide is intended to help users with the migration process from 1.x to 2.x.

Package Name Change

The package name of the library has changed from nz.bradcampbell.paperparcel to just paperparcel.

Additionally, the artifacts are no longer available on jitpack and are instead available on jcenter and mavenCentral under a new group id. See Download for more info.

Wrappers

PaperParcel used to have a concept of Parcelable wrappers. These no longer exist in 2.x. There are several reasons for removing them:

Instead, PaperParcel 2.x just generates the CREATOR and writeToParcel(...) implementations for you. Then you can simply make your model objects implement Parcelable and use/call the generated code from your model.

Here's a list of things you need to do to remove all of the old wrapper-based code:

Type Adapters

The TypeAdapter API hasn't changed, but the API for adding them has. See Processor Configuration from the website to find out how to add your existing TypeAdapters.

While the API is exactly the same, TypeAdapters have actually gained some new tricks. See Type Adapters from the website to find out more.

Proguard

You can delete the old rules associated with this library. PaperParcel 2.x doesn't use reflection anymore. If you're opting into the reflection-enhanced API in paperparcel-kotlin, the rules now ship with the AAR so you don't need to do anything.


Back to main site.