remove printMovie method from MovieService and override tostring method in Movie class

This commit is contained in:
2026-04-28 09:37:50 +03:30
parent 1a6f0a7c41
commit 9acd7ae488
2 changed files with 18 additions and 15 deletions
+17
View File
@@ -171,4 +171,21 @@ public class Movie {
public void setPoster(String poster) { this.poster = poster; }
@Override
public String toString() {
String result = "=".repeat(70) + "\n"
+ " ".repeat(20) + this.getTitle() + " (" + this.getYear() + ")" + "\n"
+ "=".repeat(70) + "\n"
+ "Rating: " + this.getImdb_rating() + "/10" + " | " + "Votes: " + this.getImdb_votes() + "\n"
+ "Director: " + this.getDirector() + "\n"
+ "Cast: " + this.getActors() + "\n"
+ "Genre: " + this.getGenres() + "\n"
+ "Runtime: " + this.getRuntime() + " | " + "Rated: " + this.getRated() + "\n"
+ "Country: " + this.getCountry() + " | " + "Released: " + this.getReleased() + "\n"
+ "Plot: " + this.getPlot() + "\n"
+ "Awards: " + this.getAwards() + "\n"
+ "=".repeat(70);
return result;
}
}