89 lines
1.8 KiB
Java
89 lines
1.8 KiB
Java
package movie.apis;
|
|
|
|
import java.util.List;
|
|
|
|
/**
|
|
* Model class representing a movie
|
|
* Fields: id, title, genres, images
|
|
*/
|
|
public class Movie {
|
|
|
|
private Long id;
|
|
private String title;
|
|
private List<String> genres;
|
|
private String images;
|
|
private String year;
|
|
private String imdb_rating;
|
|
private String country;
|
|
|
|
// TODO: Create a constructor with all fields
|
|
public Movie(Long id, String title, List<String> genres, String images, String year, String imdb_rating, String country){
|
|
this.id = id;
|
|
this.title = title;
|
|
this.genres = genres;
|
|
this.images = images;
|
|
this.year = year;
|
|
this.imdb_rating = imdb_rating;
|
|
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 String getTitle() {
|
|
return title;
|
|
}
|
|
|
|
public List<String> getGenres() {
|
|
return genres;
|
|
}
|
|
|
|
public String getImages() {
|
|
return images;
|
|
}
|
|
|
|
public String getImdb_rating() {
|
|
return imdb_rating;
|
|
}
|
|
|
|
public String getYear() {
|
|
return year;
|
|
}
|
|
|
|
public String getCountry() {
|
|
return country;
|
|
}
|
|
|
|
public void setGenres(List<String> genres) {
|
|
this.genres = genres;
|
|
}
|
|
|
|
public void setImages(String images) {
|
|
this.images = images;
|
|
}
|
|
|
|
public void setImdb_rating(String imdb_rating) {
|
|
this.imdb_rating = imdb_rating;
|
|
}
|
|
|
|
public void setYear(String year) {
|
|
this.year = year;
|
|
}
|
|
|
|
public void setCountry(String country) {
|
|
this.country = country;
|
|
}
|
|
|
|
@Override
|
|
public String toString() {
|
|
return id + ". " + title;
|
|
}
|
|
} |