🚧 Make Movie and Performance JSON-serializable
[rhynodge.git] / src / main / java / net / pterodactylus / rhynodge / filters / webpages / savoy / Performance.java
1 package net.pterodactylus.rhynodge.filters.webpages.savoy;
2
3 import com.fasterxml.jackson.annotation.JsonProperty;
4
5 import java.time.LocalDateTime;
6 import java.util.Objects;
7
8 /**
9  * Information about a performance and a link to buy a ticket.
10  */
11 public class Performance {
12
13         @JsonProperty
14         private final LocalDateTime time;
15
16         @JsonProperty
17         private final String link;
18
19         public Performance() {
20                 this(null, null);
21         }
22
23         public Performance(LocalDateTime time, String link) {
24                 this.time = time;
25                 this.link = link;
26         }
27
28         public LocalDateTime getTime() {
29                 return time;
30         }
31
32         public String getLink() {
33                 return link;
34         }
35
36         @Override
37         public int hashCode() {
38                 return Objects.hash(time, link);
39         }
40
41         @Override
42         public boolean equals(Object o) {
43                 if (this == o) return true;
44                 if (o == null || getClass() != o.getClass()) return false;
45                 Performance that = (Performance) o;
46                 return Objects.equals(time, that.time) && Objects.equals(link, that.link);
47         }
48
49 }