1 package net.pterodactylus.rhynodge.filters.webpages.savoy;
3 import com.fasterxml.jackson.annotation.JsonProperty;
5 import java.util.ArrayList;
7 import java.util.Objects;
8 import java.util.stream.Collectors;
10 import static java.lang.String.format;
13 * Information about a movie.
15 * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
20 private final String name;
23 private final List<Performance> performances = new ArrayList<>();
29 public Movie(String name) {
33 public String getName() {
37 public List<Performance> getPerformances() {
41 public void addPerformance(Performance performance) {
42 performances.add(performance);
46 public String toString() {
47 return format("%s (%s)", name, performances.stream().map(link -> String.format("%s: %s", link.getTime(), link.getLink())).collect(Collectors.joining(", ")));
51 public int hashCode() {
52 return Objects.hash(name, performances);
56 public boolean equals(Object o) {
57 if (this == o) return true;
58 if (o == null || getClass() != o.getClass()) return false;
59 Movie movie = (Movie) o;
60 return Objects.equals(name, movie.name) && Objects.equals(performances, movie.performances);