Skip to content

Instantly share code, notes, and snippets.

@sourabhv
Last active May 26, 2017 05:32
Show Gist options
  • Save sourabhv/8bbc84f0fb4f277ca311d3023016ce4e to your computer and use it in GitHub Desktop.
Save sourabhv/8bbc84f0fb4f277ca311d3023016ce4e to your computer and use it in GitHub Desktop.
Repository Design Pattern in Android using RxJava, Retrofit, SQLBrite and SQLDelight Raw
@AutoValue
public abstract class Address implements AddressModel, Parcelable {
public static final Factory<Address> FACTORY = new Factory<>(AutoValue_Address::new);
public static final Func1<Cursor, Address> MAPPER = FACTORY.selectAllMapper()::map;
public static Builder builder() {
return new AutoValue_Address.Builder();
}
@AutoValue.Builder
public static abstract class Builder {
public abstract Builder id(long id);
public abstract Builder name(String name);
public abstract Builder line1(String line1);
public abstract Builder line2(String line2);
public abstract Builder landmark(String landmark);
public abstract Builder city(String city);
public abstract Builder country(String country);
public abstract Builder pincode(long pincode);
public abstract Address build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment