This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Item | |
{ | |
private String sku; | |
private String barcode; | |
private boolean backup, removed; | |
private int external_srr_reservation_id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"sku":"AB123_S", | |
"barcode":"038678561125", | |
"backup":false, | |
"removed":true, | |
"external_srr_reservation_id":0, | |
"external_rb_reservation_id":1 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class ItemTest { | |
private static ObjectMapper MAPPER = new ObjectMapperFactory().build(); | |
private Item item = Item.create("AB123_S", "038678561125", false, true, 0, 1); | |
@Test | |
public void testJsonSerialization() throws IOException { | |
String json = MAPPER.writeValueAsString(item); | |
assertEquals(jsonFixture("fixtures/Item.json"), json); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<dependency> | |
<groupId>com.google.auto.value</groupId> | |
<artifactId>auto-value</artifactId> | |
</dependency> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>org.bsc.maven</groupId> | |
<artifactId>maven-processor-plugin</artifactId> | |
<version>2.0.5</version> | |
<executions> | |
<execution> | |
<id>process</id> | |
<goals> | |
<goal>process</goal> | |
</goals> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<plugin> | |
<groupId>org.apache.maven.plugins</groupId> | |
<artifactId>maven-compiler-plugin</artifactId> | |
<configuration> | |
<compilerArgument>-proc:none</compilerArgument> | |
</configuration> | |
</plugin> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@javax.annotation.Generated("com.google.auto.value.processor.AutoValueProcessor") | |
final class AutoValue_Item extends Item { | |
private final String sku; | |
private final String barcode; | |
private final boolean backup; | |
private final boolean removed; | |
private final int external_srr_reservation_id; | |
private final int external_rb_reservation_id; | |
AutoValue_Item( |
OlderNewer