You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
929 B

package com.example.sbcamel;
import java.io.Serializable;
import java.util.StringJoiner;
import jakarta.validation.constraints.NotNull;
import jakarta.validation.constraints.Size;
/**
* User entity
*
*/
@SuppressWarnings("serial")
public class User implements Serializable {
@NotNull(message = "custom message")
private Integer id;
@NotNull
@Size(min = 3, max = 20)
private String name;
public User() {
}
public User(Integer id, String name) {
this.id = id;
this.name = name;
}
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
@Override
public String toString() {
return new StringJoiner(", ", User.class.getSimpleName() + "[", "]").add("id=" + id).add("name='" + name + "'")
.toString();
}
}