mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-14 08:58:26 +00:00
Fix spelling error: Genre.FANTAST (#2512)
This commit is contained in:
+2
-2
@@ -100,7 +100,7 @@ Book withPublicationDate(LocalDate publicationDate);
|
||||
The semantics of the `builder` function can easily be understood. The `builder` function returns a function `AddGenre`, which adds the genre to the book. Similarity, the `AddGenre` function returns another function `AddTitle`, which adds the title to the book and so on, until the `AddPublicationDate` function returns a `Book`.
|
||||
For example, we could create a `Book` as follows:
|
||||
```java
|
||||
Book book = Book.builder().withGenre(Genre.FANTAST)
|
||||
Book book = Book.builder().withGenre(Genre.FANTASY)
|
||||
.withAuthor("Author")
|
||||
.withTitle("Title")
|
||||
.withPublicationDate(LocalDate.of(2000, 7, 2));
|
||||
@@ -188,4 +188,4 @@ Cons
|
||||
## Credits
|
||||
* [Currying in Java](https://www.baeldung.com/java-currying)
|
||||
* [What Is Currying in Programming](https://towardsdatascience.com/what-is-currying-in-programming-56fd57103431#:~:text=Currying%20is%20helpful%20when%20you,concise%2C%20and%20more%20readable%20solution.)
|
||||
* [Why the fudge should I use currying?](https://medium.com/dailyjs/why-the-fudge-should-i-use-currying-84e4000c8743)
|
||||
* [Why the fudge should I use currying?](https://medium.com/dailyjs/why-the-fudge-should-i-use-currying-84e4000c8743)
|
||||
|
||||
Reference in New Issue
Block a user