From 36d31c8e6f98eb9c7cf74de3c3fedba1a9caec14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Dyda?= Date: Tue, 25 Oct 2022 20:00:02 +0200 Subject: [PATCH] Builder design pattern for Housing class. --- demo/02/src/main/java/pl/amu/edu/demo/data/Housing.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/demo/02/src/main/java/pl/amu/edu/demo/data/Housing.java b/demo/02/src/main/java/pl/amu/edu/demo/data/Housing.java index 79d0f71..e8b8a41 100644 --- a/demo/02/src/main/java/pl/amu/edu/demo/data/Housing.java +++ b/demo/02/src/main/java/pl/amu/edu/demo/data/Housing.java @@ -2,11 +2,14 @@ package pl.amu.edu.demo.data; import lombok.AccessLevel; import lombok.AllArgsConstructor; +import lombok.Builder; import lombok.experimental.FieldDefaults; -@AllArgsConstructor +@AllArgsConstructor(access = AccessLevel.PRIVATE) @FieldDefaults(level = AccessLevel.PUBLIC, makeFinal = true) +@Builder public class Housing { Address address; boolean isApartment; + Double area; }