content: package com.an.constraintlayout.sample.model;
  
  import com.an.constraintlayout.sample.utils.BaseUtils;
  import com.google.gson.annotations.SerializedName;
  
  import java.io.Serializable;
  import java.util.ArrayList;
  import java.util.List;
  
  public class Movie implements Serializable {
  
      private transient String IMAGE_URL = "https://image.tmdb.org/t/p/w500%s";
  
      private boolean adult;
  
      @SerializedName("backdrop_path")
      private String backdropPath;
  
      private Double budget;
  
      private List<Object> genres;
  
      private String homepage;
      private String url;
      private long id;
  
      @SerializedName(value="imdbId", alternate={"imdb_id", "imdb_code"})
      private String imdbId;
  
      @SerializedName("original_language")
      private String originalLanguage;
  
      @SerializedName("original_title")
      private String originalTitle;
  
      @SerializedName(value="description", alternate={"overview", "synopsis"})
      private String description;
  
      private Double popularity;
  
      @SerializedName(value="posterPath", alternate={"poster_path", "large_cover_image"})
      private String posterPath;
  
      @SerializedName("release_date")
      private String releaseDate;
  
      private Long revenue;
  
      private Integer runtime;
  
      private String status;
      private String tagline;
      private String title;
  
      @SerializedName(value="voteAverage", alternate={"vote_average", "rating"})
      private Float voteAverage;
  
      @SerializedName("vote_count")
      private Double voteCount;
  
      @SerializedName("genre_ids")
      private List<Integer> genreIds;
  
      @SerializedName("yt_trailer_code")
      private String trailerCode;
  
      public boolean isAdult() {
          return adult;
      }
  
      public void setAdult(boolean adult) {
          this.adult = adult;
      }
  
      public String getBackdropPath() {
          return backdropPath;
      }
  
      public void setBackdropPath(String backdropPath) {
          this.backdropPath = backdropPath;
      }
  
      public Double getBudget() {
          return budget;
      }
  
      public void setBudget(Double budget) {
          this.budget = budget;
      }
  
      public String getHomepage() {
          return homepage;
      }
  
      public void setHomepage(String homepage) {
          this.homepage = homepage;
      }
  
      public long getId() {
          return id;
      }
  
      public void setId(long id) {
          this.id = id;
      }
  
      public String getImdbId() {
          return imdbId;
      }
  
      public void setImdbId(String imdbId) {
          this.imdbId = imdbId;
      }
  
      public String getOriginalLanguage() {
          return originalLanguage;
      }
  
      public void setOriginalLanguage(String originalLanguage) {
          this.originalLanguage = originalLanguage;
      }
  
      public String getOriginalTitle() {
          return originalTitle;
      }
  
      public void setOriginalTitle(String originalTitle) {
          this.originalTitle = originalTitle;
      }
  
      public String getDescription() {
          return description;
      }
  
      public void setDescription(String description) {
          this.description = description;
      }
  
      public Double getPopularity() {
          return popularity;
      }
  
      public void setPopularity(Double popularity) {
          this.popularity = popularity;
      }
  
      public String getPosterPath() {
          if(posterPath != null && !posterPath.startsWith("http")) {
              posterPath = String.format(IMAGE_URL, posterPath);
          }
          return posterPath;
      }
  
      public void setPosterPath(String posterPath) {
          this.posterPath = posterPath;
      }
  
      public String getReleaseDate() {
          return releaseDate;
      }
  
      public void setReleaseDate(String releaseDate) {
          this.releaseDate = releaseDate;
      }
  
      public Long getRevenue() {
          return revenue;
      }
  
      public void setRevenue(Long revenue) {
          this.revenue = revenue;
      }
  
      public Integer getRuntime() {
          return runtime;
      }
  
      public void setRuntime(Integer runtime) {
          this.runtime = runtime;
      }
  
      public String getStatus() {
          return status;
      }
  
      public void setStatus(String status) {
          this.status = status;
      }
  
      public String getTagline() {
          return tagline;
      }
  
      public void setTagline(String tagline) {
          this.tagline = tagline;
      }
  
      public String getTitle() {
          return title;
      }
  
      public void setTitle(String title) {
          this.title = title;
      }
  
      public Float getVoteAverage() {
          return voteAverage;
      }
  
      public void setVoteAverage(Float voteAverage) {
          this.voteAverage = voteAverage;
      }
  
      public Double getVoteCount() {
          return voteCount;
      }
  
      public void setVoteCount(Double voteCount) {
          this.voteCount = voteCount;
      }
  
      public List<Integer> getGenreIds() {
          return genreIds;
      }
  
      public void setGenreIds(List<Integer> genreIds) {
          this.genreIds = genreIds;
      }
  
      public String getTrailerCode() {
          return trailerCode;
      }
  
      public void setTrailerCode(String trailerCode) {
          this.trailerCode = trailerCode;
      }
  
      public String getUrl() {
          return url;
      }
  
      public void setUrl(String url) {
          this.url = url;
      }
  
      public List<Object> getGenres() {
          return genres;
      }
  
      public void setGenres(List<Object> genres) {
          this.genres = genres;
      }
  
      public List<String> getGenreNames() {
          return BaseUtils.getGenres(getGenres());
      }
  
      public List<Video> getTrailers() {
          List<Video> videos = new ArrayList<>();
          if(getTrailerCode() != null) {
              Video video = new Video();
              video.setKey(getTrailerCode());
              videos.add(video);
          }
          return videos;
      }
  }
  