Skip to content

Instantly share code, notes, and snippets.

@naturalwarren
Last active Jan 16, 2017
Embed
What would you like to do?
Rider Model with Immutable Collections
@AutoValue
public abstract class Rider {
public abstract String firstName();
public abstract String lastName();
public abstract String phoneNumber();
public abstract ImmutableList<PaymentProfile> paymentProfiles();
public abstract ImmutableMap<String, String> thirdPartyIdentities();
@AutoValue.Builder
public abstract static class Builder {
public abstract Builder firstName(String firstName);
public abstract Builder lastName(String lastName);
public abstract Builder phoneNumber(String mobileDidgits);
public abstract Builder paymentProfiles(List<PaymentProfile> profiles);
public abstract Builder thirdPartyIdentities(Map<String, String> identities);
public abstract Rider build();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment