114 lines
3.6 KiB
Java
114 lines
3.6 KiB
Java
package movie.apis;
|
|
|
|
import com.google.gson.annotations.SerializedName;
|
|
import java.util.List;
|
|
|
|
public class Movie {
|
|
private Long id;
|
|
private String title;
|
|
private String year;
|
|
private String country;
|
|
|
|
// استفاده از SerializedName برای تطبیق دقیق با کلیدهای JSON
|
|
@SerializedName("imdb_rating")
|
|
private String imdbRating;
|
|
|
|
@SerializedName("imdb_votes")
|
|
private String imdbVotes;
|
|
|
|
private String director;
|
|
private String actors;
|
|
private String plot;
|
|
private String awards;
|
|
private String rated;
|
|
private String runtime;
|
|
|
|
private List<String> genres;
|
|
private List<String> images;
|
|
private String metascore;
|
|
|
|
@SerializedName("imdb_id")
|
|
private String imdbId;
|
|
|
|
public void setImdbRating(String imdbRating) {
|
|
this.imdbRating = imdbRating;
|
|
}
|
|
|
|
private String released;
|
|
private String type;
|
|
private String writer;
|
|
|
|
|
|
// Constructor کامل
|
|
public Movie(Long id, String title, String year, String country, String imdbRating, String imdbVotes,
|
|
String director, String actors, String plot, String awards, String rated, String runtime,
|
|
List<String> genres, List<String> images) {
|
|
|
|
this.id = id;
|
|
this.title = title;
|
|
this.year = year;
|
|
this.country = country;
|
|
this.imdbRating = imdbRating;
|
|
this.imdbVotes = imdbVotes;
|
|
this.director = director;
|
|
this.actors = actors;
|
|
this.plot = plot;
|
|
this.awards = awards;
|
|
this.rated = rated;
|
|
this.runtime = runtime;
|
|
this.genres = genres;
|
|
this.images = images;
|
|
}
|
|
|
|
// Constructor ساده
|
|
public Movie(Long id, String title) {
|
|
this.id = id;
|
|
this.title = title;
|
|
}
|
|
|
|
// Getters and Setters
|
|
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 String getYear() { return year; }
|
|
public void setYear(String year){ this.year = year;}
|
|
public String getCountry() { return country; }
|
|
public void setCountry(String country) { this.country = country; }
|
|
|
|
public List<String> getGenres() { return genres; }
|
|
public void setGenres(List<String> genres) { this.genres = genres; }
|
|
|
|
public List<String> getImages() { return images; }
|
|
public void setImages(List<String> images) { this.images = images; }
|
|
|
|
public String getMetascore() { return metascore; }
|
|
public void setMetascore(String metascore) { this.metascore = metascore; }
|
|
|
|
public String getImdbId() { return imdbId; }
|
|
public void setImdbId(String imdbId) { this.imdbId = imdbId; }
|
|
|
|
public String getReleased() { return released; }
|
|
public void setReleased(String released) { this.released = released; }
|
|
|
|
public String getType() { return type; }
|
|
public void setType(String type) { this.type = type; }
|
|
|
|
public void setImdbVotes(String imdbVotes) {
|
|
this.imdbVotes = imdbVotes;
|
|
}
|
|
|
|
public String getWriter() { return writer; }
|
|
public void setWriter(String writer) { this.writer = writer; }
|
|
|
|
public String getImdbRating() { return imdbRating; }
|
|
public String getImdbVotes() { return imdbVotes; }
|
|
public String getDirector() { return director; }
|
|
public String getActors() { return actors; }
|
|
public String getPlot() { return plot; }
|
|
public String getAwards() { return awards; }
|
|
public String getRated() { return rated; }
|
|
public String getRuntime() { return runtime; }
|
|
public String getGenre() { return genres != null ? String.join(", ", genres) : "N/A";
|
|
}
|
|
} |