Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/frankiesardo/auto-parcel
Android Parcelable models made easy
https://github.com/frankiesardo/auto-parcel
Last synced: about 1 month ago
JSON representation
Android Parcelable models made easy
- Host: GitHub
- URL: https://github.com/frankiesardo/auto-parcel
- Owner: frankiesardo
- License: epl-1.0
- Created: 2014-03-13T19:30:16.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2017-02-12T15:10:29.000Z (almost 8 years ago)
- Last Synced: 2024-10-01T09:32:13.671Z (about 2 months ago)
- Language: Clojure
- Homepage:
- Size: 370 KB
- Stars: 1,373
- Watchers: 42
- Forks: 82
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.md
Awesome Lists containing this project
README
AutoParcel
============[![Build status](https://circleci.com/gh/frankiesardo/auto-parcel.svg?style=shield)](https://circleci.com/gh/frankiesardo/auto-parcel)
AutoParcel is an [AutoValue](https://github.com/google/auto/tree/master/value) extension that enables Parcelable values generation.
Just add `implements Parcelable` to your `@AutoValue` annotated models.
```java
addresses();
@AutoValue
abstract class Person implements Parcelable {
abstract String name();
abstract List
abstract Map likes();static Person create(String name, List
addresses, Map 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.
Download
--------[![Clojars Project](http://clojars.org/frankiesardo/auto-parcel/latest-version.svg)](http://clojars.org/frankiesardo/auto-parcel)
Use the same dependency qualifier that you would use for AutoValue (e.g. `apt`)
```groovy
buildscript {
repositories {
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:1.0.0'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.4'
}
}apply plugin: 'com.android.application'
apply plugin: 'com.neenbedankt.android-apt'repositories {
mavenCentral()
jcenter()
maven {url "https://clojars.org/repo/"}
}dependencies {
apt 'frankiesardo:auto-parcel:{{latest-version}}'
}```
_Notice the clojars line in your maven repositories_I recommend using the [`android-apt`](https://bitbucket.org/hvisser/android-apt) plugin so that Android Studio picks up the generated files.
Check out the sample project for a working example.Roadmap
--------- [ ] Dismantle instanceof checks speeding up runtime serialization [#16](/../../issues/16)
- [ ] Walking up superclasses to ensure the object is Parcelable [#7](/../../issues/7)