♻️ Remove “addPerformance” method
[rhynodge.git] / src / main / java / net / pterodactylus / rhynodge / filters / webpages / savoy / Movie.java
index 8d9f1f6..76c766f 100644 (file)
@@ -3,11 +3,13 @@ package net.pterodactylus.rhynodge.filters.webpages.savoy;
 import com.fasterxml.jackson.annotation.JsonProperty;
 
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.List;
 import java.util.Objects;
 import java.util.stream.Collectors;
 
 import static java.lang.String.format;
+import static java.util.Collections.emptyList;
 
 /**
  * Information about a movie.
@@ -37,9 +39,14 @@ public class Movie {
        }
 
        public Movie(String name, String imageUrl, String description) {
+               this(name, imageUrl, description, emptyList());
+       }
+
+       public Movie(String name, String imageUrl, String description, Collection<Performance> performances) {
                this.name = name;
                this.imageUrl = imageUrl;
                this.description = description;
+               this.performances.addAll(performances);
        }
 
        public String getName() {
@@ -58,10 +65,6 @@ public class Movie {
                return performances;
        }
 
-       public void addPerformance(Performance performance) {
-               performances.add(performance);
-       }
-
        @Override
        public String toString() {
                return format("%s (%s, %s, %s)", name, imageUrl, description, performances.stream().map(link -> String.format("%s: %s", link.getTime(), link.getLink())).collect(Collectors.joining(", ")));