develop #3

Closed
bitahajati wants to merge 4 commits from bitahajati/HW-03-oop-and-api:develop into main
2 changed files with 45 additions and 7 deletions
Showing only changes of commit 6f8c0d8f7e - Show all commits
+44 -4
View File
@@ -6,7 +6,8 @@ import java.util.List;
* Model class representing a movie
* Fields: id, title, genres, images
*/
public class Movie {
public class Movie
{
private Long id;
private String title;
@@ -16,9 +17,48 @@ public class Movie {
private String imdbRating;
private String country;
// TODO: Create a constructor with all fields
public Movie(Long id, String title, List<Genre> genres, String images, String year, String imdbRating, String country)
{
this.id = id;
this.title = title;
this.genres = genres;
this.images = images;
this.year = year;
this.imdbRating = imdbRating;
this.country = country;
}
// TODO: Create a simple constructor with id and title only
public Movie(Long id, String title)
{
this.id = id;
this.title = title;
}
// TODO: Create getters and setters for all fields
public Long getId() { return id; }
public void setId(Long id) { this.id = id; }
public String getTitle() { return title; }
public void setTitle(String title) { this.title = title; }
public List<Genre> getGenres() { return genres; }
public void setGenres(List<Genre> genres) { this.genres = genres; }
public String getImages() { return images; }
public void setImages(String images) { this.images = images; }
public String getYear() { return year; }
public void setYear(String year) { this.year = year; }
public String getImdbRating() { return imdbRating; }
public void setImdbRating(String imdbRating) { this.imdbRating = imdbRating; }
public String getCountry() { return country; }
public void setCountry(String country) { this.country = country; }
}
+1 -3
View File
@@ -102,10 +102,8 @@ public class MovieService {
* PUT ALL PARSING CODE INSIDE try-catch
*/
public void displayMoviesByGenre(Long genreId, Long page) {
// TODO: Write your code here
// All parsing code must be inside try-catch
try {
// Your code here
} catch (Exception e) {
System.err.println("ERROR: " + e.getMessage());