Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
17 changes: 10 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
<version>1.0-SNAPSHOT</version>

<properties>
<java.version>21</java.version>
<java.version>25</java.version>
<record-builder.version>52</record-builder.version>
<sonar.projectKey>piomin_sample-java-playground</sonar.projectKey>
<sonar.organization>piomin</sonar.organization>
<sonar.host.url>https://sonarcloud.io</sonar.host.url>
Expand All @@ -31,11 +32,6 @@
<artifactId>guava</artifactId>
<version>33.5.0-jre</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.42</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
Expand All @@ -45,7 +41,7 @@
<dependency>
<groupId>io.soabase.record-builder</groupId>
<artifactId>record-builder-processor</artifactId>
<version>52</version>
<version>${record-builder.version}</version>
<scope>provided</scope>
</dependency>
</dependencies>
Expand All @@ -58,6 +54,13 @@
<version>3.15.0</version>
<configuration>
<release>${java.version}</release>
<annotationProcessorPaths>
<path>
<groupId>io.soabase.record-builder</groupId>
<artifactId>record-builder-processor</artifactId>
<version>${record-builder.version}</version>
</path>
</annotationProcessorPaths>
</configuration>
</plugin>
<plugin>
Expand Down
80 changes: 69 additions & 11 deletions src/main/java/pl/piomin/services/playground/model/Person.java
Original file line number Diff line number Diff line change
@@ -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 +
'}';
}

}
Original file line number Diff line number Diff line change
@@ -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 +
'}';
}

}
Loading