Skip to content

Instantly share code, notes, and snippets.

@markusdybeck
Last active June 10, 2020 11:13
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 markusdybeck/5b198754a1dbcf82829ef3f98a55b192 to your computer and use it in GitHub Desktop.
Save markusdybeck/5b198754a1dbcf82829ef3f98a55b192 to your computer and use it in GitHub Desktop.
A more complex record model with more arguments
public record Product(ProductId id, String name, String description, Images images, Attributes attributes) {
public Product {
Objects.requireNonNull(id);
// ...
}
};
var product = new Product(new ProductId(1), "Nimbus 2000", "Fastest broom on the market", new Images(), new Attributes());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment