Last active
June 10, 2020 11:13
-
-
Save markusdybeck/5b198754a1dbcf82829ef3f98a55b192 to your computer and use it in GitHub Desktop.
A more complex record model with more arguments
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 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