A tool for generating Persistable implementation.
Created specially for Binaryprefs
PersistableGenerator generates the Persistable wrapper for data classes to get rid of boilerplate source code.
All you need is to annotate the data class by the annotation @PersistableGenerator
@PersistableGenerator public class SomeModel {
int age;
private String name;
public SomeModel() {
}
public SomeModel(int age, String name) {
this.age = age;
this.name = name;
}
public String getName() {
return name;
}
public int getAge() {
return age;
}
}
@PersistableGenerator
data class SomeModel(val name: String, val age: Int, val someList: List<OtherModel>, val someInts: List<Int>, val someStrings: List<String>)
Library generates wrapper class SomeModelPersistable
implements Persistable
and you can use it next way:
Persistable persistableModel = new SomeModelPersistable(model);
def persistableGeneratorVersion = 'x.x.x'
...
dependencies {
provided "com.github.lliepmah:persistable-generator-annotations:$persistableGeneratorVersion"
annotationProcessor "com.github.lliepmah:persistable-generator-compiler:$persistableGeneratorVersion"
...
}
def persistableGeneratorVersion = 'x.x.x'
dependencies {
provided "com.github.lliepmah:persistable-generator-annotations:$persistableGeneratorVersion"
kapt "com.github.lliepmah:persistable-generator-compiler:$persistableGeneratorVersion"
...
}
No special ProGuard rules required.