🎨 Add “imageUrl” attribute to Movie
[rhynodge.git] / src / main / java / net / pterodactylus / rhynodge / filters / webpages / savoy / Movie.java
index 0844b7c..5e831d8 100644 (file)
@@ -20,20 +20,28 @@ public class Movie {
        private final String name;
 
        @JsonProperty
+       private final String imageUrl;
+
+       @JsonProperty
        private final List<Performance> performances = new ArrayList<>();
 
        public Movie() {
-               this("");
+               this("", "");
        }
 
-       public Movie(String name) {
+       public Movie(String name, String imageUrl) {
                this.name = name;
+               this.imageUrl = imageUrl;
        }
 
        public String getName() {
                return name;
        }
 
+       public String getImageUrl() {
+               return imageUrl;
+       }
+
        public List<Performance> getPerformances() {
                return performances;
        }
@@ -44,12 +52,12 @@ public class Movie {
 
        @Override
        public String toString() {
-               return format("%s (%s)", name, performances.stream().map(link -> String.format("%s: %s", link.getTime(), link.getLink())).collect(Collectors.joining(", ")));
+               return format("%s (%s, %s)", name, imageUrl, performances.stream().map(link -> String.format("%s: %s", link.getTime(), link.getLink())).collect(Collectors.joining(", ")));
        }
 
        @Override
        public int hashCode() {
-               return Objects.hash(name, performances);
+               return Objects.hash(name, imageUrl, performances);
        }
 
        @Override
@@ -57,7 +65,7 @@ public class Movie {
                if (this == o) return true;
                if (o == null || getClass() != o.getClass()) return false;
                Movie movie = (Movie) o;
-               return Objects.equals(name, movie.name) && Objects.equals(performances, movie.performances);
+               return Objects.equals(name, movie.name) && Objects.equals(imageUrl, movie.imageUrl) && Objects.equals(performances, movie.performances);
        }
 
 }