all
This commit is contained in:
178
ProgramaNetflix.java
Normal file
178
ProgramaNetflix.java
Normal file
@@ -0,0 +1,178 @@
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class ProgramaNetflix {
|
||||
|
||||
private String id;
|
||||
private String titulo;
|
||||
private String show_type;
|
||||
private String descricao;
|
||||
private int release_year;
|
||||
private String age_certification;
|
||||
private int runtime;
|
||||
private String generos;
|
||||
private String production_countries;
|
||||
private float temporadas;
|
||||
private String imdb_id;
|
||||
private double imdb_score;
|
||||
private float imdb_votes;
|
||||
private double tmdb_popularity;
|
||||
private double tmdb_score;
|
||||
|
||||
public ProgramaNetflix(String id, String titulo, String show_type, String descricao, int release_year,
|
||||
String age_certification, int runtime, String generos, String production_countries, float temporadas,
|
||||
String imdb_id, double imdb_score, float imdb_votes, double tmdb_popularity, double tmdb_score) {
|
||||
this.id = id;
|
||||
this.titulo = titulo;
|
||||
this.show_type = show_type;
|
||||
this.descricao = descricao;
|
||||
this.release_year = release_year;
|
||||
this.age_certification = age_certification;
|
||||
this.runtime = runtime;
|
||||
this.generos = generos;
|
||||
this.production_countries = production_countries;
|
||||
this.temporadas = temporadas;
|
||||
this.imdb_id = imdb_id;
|
||||
this.imdb_score = imdb_score;
|
||||
this.imdb_votes = imdb_votes;
|
||||
this.tmdb_popularity = tmdb_popularity;
|
||||
this.tmdb_score = tmdb_score;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getTitulo() {
|
||||
return titulo;
|
||||
}
|
||||
|
||||
public void setTitulo(String titulo) {
|
||||
this.titulo = titulo;
|
||||
}
|
||||
|
||||
public String getShow_type() {
|
||||
return show_type;
|
||||
}
|
||||
|
||||
public void setShow_type(String show_type) {
|
||||
this.show_type = show_type;
|
||||
}
|
||||
|
||||
public String getDescricao() {
|
||||
return descricao;
|
||||
}
|
||||
|
||||
public void setDescricao(String descricao) {
|
||||
this.descricao = descricao;
|
||||
}
|
||||
|
||||
public int getRelease_year() {
|
||||
return release_year;
|
||||
}
|
||||
|
||||
public void setRelease_year(int release_year) {
|
||||
this.release_year = release_year;
|
||||
}
|
||||
|
||||
public String getAge_certification() {
|
||||
return age_certification;
|
||||
}
|
||||
|
||||
public void setAge_certification(String age_certification) {
|
||||
this.age_certification = age_certification;
|
||||
}
|
||||
|
||||
public int getRuntime() {
|
||||
return runtime;
|
||||
}
|
||||
|
||||
public void setRuntime(int runtime) {
|
||||
this.runtime = runtime;
|
||||
}
|
||||
|
||||
public String getGeneros() {
|
||||
return generos;
|
||||
}
|
||||
|
||||
public void setGeneros(String generos) {
|
||||
this.generos = generos;
|
||||
}
|
||||
|
||||
public List<String> getProductionCountries() {
|
||||
List<String> countries = new ArrayList<>();
|
||||
|
||||
if (production_countries != null && !production_countries.isEmpty()) {
|
||||
// Remove os colchetes e aspas e divide a string em valores individuais
|
||||
String[] countryArray = production_countries.replace("[", "").replace("]", "").replace("'", "").split(", ");
|
||||
|
||||
// Adiciona os valores à lista
|
||||
for (String country : countryArray) {
|
||||
countries.add(country);
|
||||
}
|
||||
}
|
||||
|
||||
return countries;
|
||||
}
|
||||
|
||||
public void setProduction_countries(String production_countries) {
|
||||
this.production_countries = production_countries;
|
||||
}
|
||||
|
||||
public float getTemporadas() {
|
||||
return temporadas;
|
||||
}
|
||||
|
||||
public void setTemporadas(int temporadas) {
|
||||
this.temporadas = temporadas;
|
||||
}
|
||||
|
||||
public String getImdb_id() {
|
||||
return imdb_id;
|
||||
}
|
||||
|
||||
public void setImdb_id(String imdb_id) {
|
||||
this.imdb_id = imdb_id;
|
||||
}
|
||||
|
||||
public double getImdb_score() {
|
||||
return Double.parseDouble(String.format("%.1f", imdb_score));
|
||||
}
|
||||
|
||||
public void setImdb_score(double imdb_score) {
|
||||
this.imdb_score = imdb_score;
|
||||
}
|
||||
|
||||
public float getImdb_votes() {
|
||||
return imdb_votes;
|
||||
}
|
||||
|
||||
public void setImdb_votes(int imdb_votes) {
|
||||
this.imdb_votes = imdb_votes;
|
||||
}
|
||||
|
||||
public double getTmdb_popularity() {
|
||||
return tmdb_popularity;
|
||||
}
|
||||
|
||||
public void setTmdb_popularity(double tmdb_popularity) {
|
||||
this.tmdb_popularity = tmdb_popularity;
|
||||
}
|
||||
|
||||
public double getTmdb_score() {
|
||||
return tmdb_score;
|
||||
}
|
||||
|
||||
public void setTmdb_score(double tmdb_score) {
|
||||
this.tmdb_score = tmdb_score;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Title=" + titulo + " (" + release_year + ")" + ", imdb_score=" + getImdb_score();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user