Develop #2
@@ -101,8 +101,9 @@ public class RationalTest {
|
||||
try {
|
||||
Rational zero = new Rational(0, 1);
|
||||
Rational divisionByZero = r1.divide(zero);
|
||||
} catch (ArithmeticException e) {
|
||||
} catch (IllegalArgumentException e) {
|
||||
System.out.println("Caught division by zero: " + e.getMessage());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -25,11 +25,25 @@ public class Movie {
|
||||
|
||||
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;
|
||||
@@ -58,7 +72,35 @@ public class Movie {
|
||||
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 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; }
|
||||
@@ -67,5 +109,6 @@ public class Movie {
|
||||
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"; }
|
||||
public String getGenre() { return genres != null ? String.join(", ", genres) : "N/A";
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user