Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Jackson serialization
@AutoValue
public abstract class Item
{
@JsonCreator
public static Item create(
@JsonProperty("sku") String sku,
@JsonProperty("barcode") String barcode,
@JsonProperty("backup") boolean backup,
@JsonProperty("removed") boolean removed,
@JsonProperty("external_srr_reservation_id") int external_srr,
@JsonProperty("external_rb_reservation_id") int external_rb) {
return new AutoValue_Item(sku, barcode, backup, removed, external_srr, external_rb);
}
@JsonProperty
public abstract String sku();
@JsonProperty
public abstract String barcode();
@JsonProperty
public abstract boolean backup();
@JsonProperty
public abstract boolean removed();
@JsonProperty
public abstract int external_srr_reservation_id();
@JsonProperty
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
You can’t perform that action at this time.