Skip to content

Instantly share code, notes, and snippets.

@gregturn
Created November 11, 2017 15:53
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 gregturn/5206465934361f718b9e538f90159b31 to your computer and use it in GitHub Desktop.
Save gregturn/5206465934361f718b9e538f90159b31 to your computer and use it in GitHub Desktop.
@Data
@Value
@Builder(builderMethodName = "collectionJson")
public class CollectionJson<T> {
private String version;
private String href;
private List<Link> links;
@Singular private List<Item<T>> items;
@JsonCreator
public CollectionJson(@JsonProperty("version") String version, @JsonProperty("href") String href,
@JsonProperty("links") List<Link> links, @JsonProperty("items") List<Item<T>> items) {
this.version = version;
this.href = href;
this.links = links;
this.items = items;
}
public static Item.ItemBuilder item() {
return Item.builder();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment