Coverage Summary for Class: UserInfo (com.github.malyshevhen.dto)
Class |
Class, %
|
Method, %
|
Branch, %
|
Line, %
|
UserInfo |
100%
(1/1)
|
57.7%
(15/26)
|
0%
(0/20)
|
26.8%
(15/56)
|
package com.github.malyshevhen.dto;
import java.net.URI;
import java.util.Objects;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonCreator;
import java.time.LocalDate;
import org.springframework.format.annotation.DateTimeFormat;
import org.openapitools.jackson.nullable.JsonNullable;
import java.io.Serializable;
import java.time.OffsetDateTime;
import jakarta.validation.Valid;
import jakarta.validation.constraints.*;
import org.hibernate.validator.constraints.*;
import java.util.*;
import jakarta.annotation.Generated;
/**
* Information of the user.
*/
@Generated(value = "org.openapitools.codegen.languages.SpringCodegen", date = "2024-04-30T13:08:47.886427131+03:00[Europe/Kyiv]")
public class UserInfo implements Serializable {
private static final long serialVersionUID = 1L;
private Long id;
private String email;
private String firstName;
private String lastName;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE)
private LocalDate birthDate;
private com.github.malyshevhen.domain.models.Address address;
private String phone;
public UserInfo id(Long id) {
this.id = id;
return this;
}
/**
* Id of user.
* minimum: 1
* @return id
*/
@Min(1L)
@JsonProperty("id")
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public UserInfo email(String email) {
this.email = email;
return this;
}
/**
* Users email
* @return email
*/
@JsonProperty("email")
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public UserInfo firstName(String firstName) {
this.firstName = firstName;
return this;
}
/**
* First name of user.
* @return firstName
*/
@Size(min = 1, max = 256)
@JsonProperty("firstName")
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public UserInfo lastName(String lastName) {
this.lastName = lastName;
return this;
}
/**
* Last name of user.
* @return lastName
*/
@Size(min = 1, max = 256)
@JsonProperty("lastName")
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
public UserInfo birthDate(LocalDate birthDate) {
this.birthDate = birthDate;
return this;
}
/**
* Birth date of the user.
* @return birthDate
*/
@Valid
@JsonProperty("birthDate")
public LocalDate getBirthDate() {
return birthDate;
}
public void setBirthDate(LocalDate birthDate) {
this.birthDate = birthDate;
}
public UserInfo address(com.github.malyshevhen.domain.models.Address address) {
this.address = address;
return this;
}
/**
* Get address
* @return address
*/
@Valid
@JsonProperty("address")
public com.github.malyshevhen.domain.models.Address getAddress() {
return address;
}
public void setAddress(com.github.malyshevhen.domain.models.Address address) {
this.address = address;
}
public UserInfo phone(String phone) {
this.phone = phone;
return this;
}
/**
* Users phone number
* @return phone
*/
@JsonProperty("phone")
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
UserInfo userInfo = (UserInfo) o;
return Objects.equals(this.id, userInfo.id) &&
Objects.equals(this.email, userInfo.email) &&
Objects.equals(this.firstName, userInfo.firstName) &&
Objects.equals(this.lastName, userInfo.lastName) &&
Objects.equals(this.birthDate, userInfo.birthDate) &&
Objects.equals(this.address, userInfo.address) &&
Objects.equals(this.phone, userInfo.phone);
}
@Override
public int hashCode() {
return Objects.hash(id, email, firstName, lastName, birthDate, address, phone);
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("class UserInfo {\n");
sb.append(" id: ").append(toIndentedString(id)).append("\n");
sb.append(" email: ").append(toIndentedString(email)).append("\n");
sb.append(" firstName: ").append(toIndentedString(firstName)).append("\n");
sb.append(" lastName: ").append(toIndentedString(lastName)).append("\n");
sb.append(" birthDate: ").append(toIndentedString(birthDate)).append("\n");
sb.append(" address: ").append(toIndentedString(address)).append("\n");
sb.append(" phone: ").append(toIndentedString(phone)).append("\n");
sb.append("}");
return sb.toString();
}
/**
* Convert the given object to string with each line indented by 4 spaces
* (except the first line).
*/
private String toIndentedString(Object o) {
if (o == null) {
return "null";
}
return o.toString().replace("\n", "\n ");
}
}