Newer
Older
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import { Deserializable } from "./deserializable.model";
import { Serializable } from "./serializable.model";
export class Review implements Deserializable, Serializable {
private id: number;
private userId: number;
private stars: number;
private comment: string;
constructor(input: any = null) {
if (input) {
this.deserialize(input);
} else {
this.id = 0;
this.userId = 0;
this.stars = 0;
this.comment = null;
}
}
deserialize(input: Object): this {
Object.assign(this, input);
return this;
}
serialize(): Object {
return {
id: this.id,
userId: this.userId,
stars: this.stars,
comment: this.comment,
};
}
get getId() {
return this.id;
}
set setId(id: number) {
this.id = id;
}
get getUserId() {
return this.userId;
}
set setUserId(userId: number) {
this.userId = userId;
}
get getStars() {
return this.stars;
}
set setStars(stars: number) {
this.stars = stars;
}
get getComment() {
return this.comment;
}
set setComment(comment: string) {
this.comment = comment;
}
}