Android AutoParcel

Port of Google AutoValue for the Android platform

Лицензия

Лицензия

Категории

Категории

Auto Библиотеки уровня приложения Code Generators
Группа

Группа

com.github.frankiesardo
Идентификатор

Идентификатор

auto-parcel
Последняя версия

Последняя версия

0.3.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Android AutoParcel
Port of Google AutoValue for the Android platform
Ссылка на сайт

Ссылка на сайт

https://github.com/frankiesardo/auto-parcel
Система контроля версий

Система контроля версий

https://github.com/frankiesardo/auto-parcel

Скачать auto-parcel

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/com.github.frankiesardo/auto-parcel/ -->
<dependency>
    <groupId>com.github.frankiesardo</groupId>
    <artifactId>auto-parcel</artifactId>
    <version>0.3.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.github.frankiesardo/auto-parcel/
implementation 'com.github.frankiesardo:auto-parcel:0.3.1'
// https://jarcasting.com/artifacts/com.github.frankiesardo/auto-parcel/
implementation ("com.github.frankiesardo:auto-parcel:0.3.1")
'com.github.frankiesardo:auto-parcel:jar:0.3.1'
<dependency org="com.github.frankiesardo" name="auto-parcel" rev="0.3.1">
  <artifact name="auto-parcel" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.github.frankiesardo', module='auto-parcel', version='0.3.1')
)
libraryDependencies += "com.github.frankiesardo" % "auto-parcel" % "0.3.1"
[com.github.frankiesardo/auto-parcel "0.3.1"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

AutoParcel

Build status

AutoParcel is an AutoValue extension that enables Parcelable values generation.

Just add implements Parcelable to your @AutoValue annotated models.

@AutoValue
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.

Download

Clojars Project

Use the same dependency qualifier that you would use for AutoValue (e.g. apt)

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 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
  • Walking up superclasses to ensure the object is Parcelable #7

Версии библиотеки

Версия
0.3.1
0.3
0.2