private final String imageUrl;
@JsonProperty
+ private final String description;
+
+ @JsonProperty
private final List<Performance> performances = new ArrayList<>();
public Movie() {
- this("", "");
+ this("", "", "");
}
public Movie(String name, String imageUrl) {
+ this(name, imageUrl, "");
+ }
+
+ public Movie(String name, String imageUrl, String description) {
this.name = name;
this.imageUrl = imageUrl;
+ this.description = description;
}
public String getName() {
return imageUrl;
}
+ public String getDescription() {
+ return description;
+ }
+
public List<Performance> getPerformances() {
return performances;
}
@Override
public String toString() {
- return format("%s (%s, %s)", name, imageUrl, performances.stream().map(link -> String.format("%s: %s", link.getTime(), link.getLink())).collect(Collectors.joining(", ")));
+ return format("%s (%s, %s, %s)", name, imageUrl, description, performances.stream().map(link -> String.format("%s: %s", link.getTime(), link.getLink())).collect(Collectors.joining(", ")));
}
@Override
public int hashCode() {
- return Objects.hash(name, imageUrl, performances);
+ return Objects.hash(name, imageUrl, description, performances);
}
@Override
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(imageUrl, movie.imageUrl) && Objects.equals(performances, movie.performances);
+ return Objects.equals(name, movie.name) && Objects.equals(imageUrl, movie.imageUrl) && Objects.equals(description, movie.description) && Objects.equals(performances, movie.performances);
}
}