/
NikolayIvkin
/
tutorials1
Обзор
Документация
Войти
/
NikolayIvkin
/
tutorials1
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
spring-boot-modules/spring-boot-springdoc/src/main/java/com/baeldung/restdocopenapi/Foo.java
93 строки
2 KB
Amit Pandey
JAVA-31001: Upgrade spring-boot-springdoc to boot 3 (#16139)
17 мар 2024, 17:06
Не верифицирован
17 мар 2024, 17:06
ef96037
Код
Авторство
О чём код?
package com.baeldung.restdocopenapi; import jakarta.persistence.Column; import jakarta.persistence.Entity; import jakarta.persistence.GeneratedValue; import jakarta.persistence.GenerationType; import jakarta.persistence.Id; @Entity public class Foo { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) private Long id; @Column(nullable = false) private String title; @Column() private String body; protected Foo() { } public Foo(long id, String title, String body) { this.id = id; this.title = title; this.body = body; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getTitle() { return title; } public void setTitle(String title) { this.title = title; } public String getBody() { return body; } public void setBody(String body) { this.body = body; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result; result = prime * result + ((id == null) ? 0 : id.hashCode()); result = prime * result + ((title == null) ? 0 : title.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Foo other = (Foo) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; if (title == null) { if (other.title != null) return false; } else if (!title.equals(other.title)) return false; return true; } @Override public String toString() { return "Foo [id=" + id + ", title=" + title + "]"; } }