diff --git a/.circleci/config.yml b/.circleci/config.yml
index 6db434c..4848fa5 100644
--- a/.circleci/config.yml
+++ b/.circleci/config.yml
@@ -3,7 +3,7 @@ version: 2.1
jobs:
build:
docker:
- - image: 'cimg/openjdk:21.0.9'
+ - image: 'cimg/openjdk:25.0.1'
steps:
- checkout
- run:
@@ -13,7 +13,7 @@ jobs:
executors:
jdk:
docker:
- - image: 'cimg/openjdk:21.0.9'
+ - image: 'cimg/openjdk:25.0.1'
orbs:
maven: circleci/maven@2.1.1
diff --git a/pom.xml b/pom.xml
index 28c4fb4..bf4f4d9 100644
--- a/pom.xml
+++ b/pom.xml
@@ -9,7 +9,8 @@
1.0-SNAPSHOT
- 21
+ 25
+ 52
piomin_sample-java-playground
piomin
https://sonarcloud.io
@@ -31,11 +32,6 @@
guava
33.5.0-jre
-
- org.projectlombok
- lombok
- 1.18.42
-
org.junit.jupiter
junit-jupiter-engine
@@ -45,7 +41,7 @@
io.soabase.record-builder
record-builder-processor
- 52
+ ${record-builder.version}
provided
@@ -58,6 +54,13 @@
3.15.0
${java.version}
+
+
+ io.soabase.record-builder
+ record-builder-processor
+ ${record-builder.version}
+
+
diff --git a/src/main/java/pl/piomin/services/playground/model/Person.java b/src/main/java/pl/piomin/services/playground/model/Person.java
index ad86921..ab5a2a4 100644
--- a/src/main/java/pl/piomin/services/playground/model/Person.java
+++ b/src/main/java/pl/piomin/services/playground/model/Person.java
@@ -1,21 +1,79 @@
package pl.piomin.services.playground.model;
-import lombok.AllArgsConstructor;
-import lombok.Data;
-import lombok.NonNull;
-import lombok.RequiredArgsConstructor;
-
-@Data
-@RequiredArgsConstructor
-@AllArgsConstructor
+import java.util.Objects;
public class Person {
- @NonNull
private Integer id;
- @NonNull
private String firstName;
- @NonNull
private String lastName;
private int age;
+ public Person(Integer id, String firstName, String lastName) {
+ this.id = Objects.requireNonNull(id, "id must not be null");
+ this.firstName = Objects.requireNonNull(firstName, "firstName must not be null");
+ this.lastName = Objects.requireNonNull(lastName, "lastName must not be null");
+ }
+
+ public Person(Integer id, String firstName, String lastName, int age) {
+ this.id = Objects.requireNonNull(id, "id must not be null");
+ this.firstName = Objects.requireNonNull(firstName, "firstName must not be null");
+ this.lastName = Objects.requireNonNull(lastName, "lastName must not be null");
+ this.age = age;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = Objects.requireNonNull(id, "id must not be null");
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = Objects.requireNonNull(firstName, "firstName must not be null");
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = Objects.requireNonNull(lastName, "lastName must not be null");
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ Person person = (Person) o;
+ return age == person.age && Objects.equals(id, person.id) && Objects.equals(firstName, person.firstName) && Objects.equals(lastName, person.lastName);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, firstName, lastName, age);
+ }
+
+ @Override
+ public String toString() {
+ return "Person{" +
+ "id=" + id +
+ ", firstName='" + firstName + '\'' +
+ ", lastName='" + lastName + '\'' +
+ ", age=" + age +
+ '}';
+ }
+
}
diff --git a/src/main/java/pl/piomin/services/playground/model/PersonAddress.java b/src/main/java/pl/piomin/services/playground/model/PersonAddress.java
index c7f15b7..8598775 100644
--- a/src/main/java/pl/piomin/services/playground/model/PersonAddress.java
+++ b/src/main/java/pl/piomin/services/playground/model/PersonAddress.java
@@ -1,21 +1,83 @@
package pl.piomin.services.playground.model;
-import lombok.Data;
-import lombok.NonNull;
-import lombok.RequiredArgsConstructor;
-
-@Data
-@RequiredArgsConstructor
+import java.util.Objects;
public class PersonAddress {
- @NonNull
private Integer id;
- @NonNull
private String city;
- @NonNull
private String street;
- @NonNull
private String houseNo;
private int flatNo;
+ public PersonAddress(Integer id, String city, String street, String houseNo) {
+ this.id = Objects.requireNonNull(id, "id must not be null");
+ this.city = Objects.requireNonNull(city, "city must not be null");
+ this.street = Objects.requireNonNull(street, "street must not be null");
+ this.houseNo = Objects.requireNonNull(houseNo, "houseNo must not be null");
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = Objects.requireNonNull(id, "id must not be null");
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = Objects.requireNonNull(city, "city must not be null");
+ }
+
+ public String getStreet() {
+ return street;
+ }
+
+ public void setStreet(String street) {
+ this.street = Objects.requireNonNull(street, "street must not be null");
+ }
+
+ public String getHouseNo() {
+ return houseNo;
+ }
+
+ public void setHouseNo(String houseNo) {
+ this.houseNo = Objects.requireNonNull(houseNo, "houseNo must not be null");
+ }
+
+ public int getFlatNo() {
+ return flatNo;
+ }
+
+ public void setFlatNo(int flatNo) {
+ this.flatNo = flatNo;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ PersonAddress that = (PersonAddress) o;
+ return flatNo == that.flatNo && Objects.equals(id, that.id) && Objects.equals(city, that.city) && Objects.equals(street, that.street) && Objects.equals(houseNo, that.houseNo);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, city, street, houseNo, flatNo);
+ }
+
+ @Override
+ public String toString() {
+ return "PersonAddress{" +
+ "id=" + id +
+ ", city='" + city + '\'' +
+ ", street='" + street + '\'' +
+ ", houseNo='" + houseNo + '\'' +
+ ", flatNo=" + flatNo +
+ '}';
+ }
+
}
diff --git a/src/main/java/pl/piomin/services/playground/model/PersonDTO.java b/src/main/java/pl/piomin/services/playground/model/PersonDTO.java
index 9facd6e..d53cae8 100644
--- a/src/main/java/pl/piomin/services/playground/model/PersonDTO.java
+++ b/src/main/java/pl/piomin/services/playground/model/PersonDTO.java
@@ -1,10 +1,6 @@
package pl.piomin.services.playground.model;
-import lombok.Builder;
-import lombok.Data;
-
-@Data
-@Builder
+import java.util.Objects;
public class PersonDTO {
private Integer id;
@@ -16,4 +12,168 @@ public class PersonDTO {
private String houseNo;
private int flatNo;
+ public PersonDTO() {
+ }
+
+ public PersonDTO(Integer id, String firstName, String lastName, int age, String city, String street, String houseNo, int flatNo) {
+ this.id = id;
+ this.firstName = firstName;
+ this.lastName = lastName;
+ this.age = age;
+ this.city = city;
+ this.street = street;
+ this.houseNo = houseNo;
+ this.flatNo = flatNo;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public void setFirstName(String firstName) {
+ this.firstName = firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public void setLastName(String lastName) {
+ this.lastName = lastName;
+ }
+
+ public int getAge() {
+ return age;
+ }
+
+ public void setAge(int age) {
+ this.age = age;
+ }
+
+ public String getCity() {
+ return city;
+ }
+
+ public void setCity(String city) {
+ this.city = city;
+ }
+
+ public String getStreet() {
+ return street;
+ }
+
+ public void setStreet(String street) {
+ this.street = street;
+ }
+
+ public String getHouseNo() {
+ return houseNo;
+ }
+
+ public void setHouseNo(String houseNo) {
+ this.houseNo = houseNo;
+ }
+
+ public int getFlatNo() {
+ return flatNo;
+ }
+
+ public void setFlatNo(int flatNo) {
+ this.flatNo = flatNo;
+ }
+
+ public static Builder builder() {
+ return new Builder();
+ }
+
+ public static class Builder {
+ private Integer id;
+ private String firstName;
+ private String lastName;
+ private int age;
+ private String city;
+ private String street;
+ private String houseNo;
+ private int flatNo;
+
+ public Builder id(Integer id) {
+ this.id = id;
+ return this;
+ }
+
+ public Builder firstName(String firstName) {
+ this.firstName = firstName;
+ return this;
+ }
+
+ public Builder lastName(String lastName) {
+ this.lastName = lastName;
+ return this;
+ }
+
+ public Builder age(int age) {
+ this.age = age;
+ return this;
+ }
+
+ public Builder city(String city) {
+ this.city = city;
+ return this;
+ }
+
+ public Builder street(String street) {
+ this.street = street;
+ return this;
+ }
+
+ public Builder houseNo(String houseNo) {
+ this.houseNo = houseNo;
+ return this;
+ }
+
+ public Builder flatNo(int flatNo) {
+ this.flatNo = flatNo;
+ return this;
+ }
+
+ public PersonDTO build() {
+ return new PersonDTO(id, firstName, lastName, age, city, street, houseNo, flatNo);
+ }
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+ PersonDTO personDTO = (PersonDTO) o;
+ return age == personDTO.age && flatNo == personDTO.flatNo && Objects.equals(id, personDTO.id) && Objects.equals(firstName, personDTO.firstName) && Objects.equals(lastName, personDTO.lastName) && Objects.equals(city, personDTO.city) && Objects.equals(street, personDTO.street) && Objects.equals(houseNo, personDTO.houseNo);
+ }
+
+ @Override
+ public int hashCode() {
+ return Objects.hash(id, firstName, lastName, age, city, street, houseNo, flatNo);
+ }
+
+ @Override
+ public String toString() {
+ return "PersonDTO{" +
+ "id=" + id +
+ ", firstName='" + firstName + '\'' +
+ ", lastName='" + lastName + '\'' +
+ ", age=" + age +
+ ", city='" + city + '\'' +
+ ", street='" + street + '\'' +
+ ", houseNo='" + houseNo + '\'' +
+ ", flatNo=" + flatNo +
+ '}';
+ }
+
}