Skip to content

Instantly share code, notes, and snippets.

@rtannenbaum
Created April 1, 2014 20:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rtannenbaum/9922296 to your computer and use it in GitHub Desktop.
Save rtannenbaum/9922296 to your computer and use it in GitHub Desktop.
"mutable" fields
@AutoValue
public abstract class Item
{
public static Item create(String sku, String barcode, boolean backup, boolean removed,
int external_srr, int external_rb) {
return new AutoValue_Item(sku, barcode, backup, removed, external_srr, external_rb);
}
public abstract String sku();
public abstract String barcode();
public Item withBarcode(String newBarcode) {
return new AutoValue_Item(sku(), newBarcode, backup(), removed(), external_srr_reservation_id(), external_rb_reservation_id());
}
public abstract boolean backup();
public abstract boolean removed();
public abstract int external_srr_reservation_id();
public abstract int external_rb_reservation_id();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment