Ejemplo n.º 1
0
  public Movie toMovie(MovieModel movieModel) {
    Movie movie = null;
    if (movieModel != null) {
      movie = new Movie();
      movie.setAdult(movieModel.isAdult());
      movie.setBackdropPath(movieModel.getBackdropPath());
      movie.setGenreIds(movieModel.getGenreIds());
      movie.setId(movieModel.getId());
      movie.setOriginalLanguage(movieModel.getOriginalLanguage());
      movie.setOriginalTitle(movieModel.getOriginalTitle());
      movie.setOverview(movieModel.getOverview());
      movie.setPopularity(movieModel.getPopularity());
      movie.setPosterPath(movieModel.getPosterPath());
      movie.setReleaseDate(movieModel.getReleaseDate());
      movie.setTitle(movieModel.getTitle());
      movie.setVideo(movieModel.isVideo());
      movie.setVoteAverage(movieModel.getVoteAverage());
      movie.setVoteCount(movieModel.getVoteCount());
    }

    return movie;
  }
Ejemplo n.º 2
0
  public MovieModel transform(Movie movie) {
    MovieModel movieModel = null;
    if (movie != null) {
      movieModel = new MovieModel();
      movieModel.setAdult(movie.isAdult());
      movieModel.setBackdropPath(movie.getBackdropPath());
      movieModel.setGenreIds(movie.getGenreIds());
      movieModel.setId(movie.getId());
      movieModel.setOriginalLanguage(movie.getOriginalLanguage());
      movieModel.setOriginalTitle(movie.getOriginalTitle());
      movieModel.setOverview(movie.getOverview());
      movieModel.setPopularity(movie.getPopularity());
      movieModel.setPosterPath(movie.getPosterPath());
      movieModel.setReleaseDate(movie.getReleaseDate());
      movieModel.setTitle(movie.getTitle());
      movieModel.setVideo(movie.isVideo());
      movieModel.setVoteAverage(movie.getVoteAverage());
      movieModel.setVoteCount(movie.getVoteCount());
      movieModel.setBackdropImageUrl(ImageUtility.getImageUrl(movie.getBackdropPath()));
      movieModel.setPosterImageUrl(ImageUtility.getImageUrl(movie.getPosterPath()));
    }

    return movieModel;
  }