-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRecipeDto.java
39 lines (35 loc) · 1.44 KB
/
RecipeDto.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package com.cha0stig3r.recipe.server.model;
import java.io.Serializable;
import java.util.List;
import java.util.Objects;
/**
* A DTO for the {@link Recipe} entity
*/
public record
RecipeDto(Long id, String name, String type, String description, String imgLocation,
List<String> ingredients, List<String> directions) implements Serializable {
@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
RecipeDto entity = (RecipeDto) o;
return Objects.equals(this.id, entity.id) &&
Objects.equals(this.name, entity.name) &&
Objects.equals(this.type, entity.type) &&
Objects.equals(this.description, entity.description) &&
Objects.equals(this.imgLocation, entity.imgLocation) &&
Objects.equals(this.ingredients, entity.ingredients) &&
Objects.equals(this.directions, entity.directions);
}
@Override
public String toString() {
return getClass().getSimpleName() + "(" +
"id = " + id + ", " +
"name = " + name + ", " +
"type = " + type + ", " +
"description = " + description + ", " +
"imgLocation = " + imgLocation + ", " +
"ingredients = " + ingredients + ", " +
"directions = " + directions + ")";
}
}