Back to project page UpcomingMoviesMVP.
The source code is released under:
Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Defi...
If you think the Android project UpcomingMoviesMVP listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.jlmd.android.newfilmsmvp.api.mapper; // w w w . ja v a2 s.c o m import com.jlmd.android.newfilmsmvp.api.moviedetails.model.Genre; import com.jlmd.android.newfilmsmvp.api.moviedetails.model.MovieDetailsResult; import com.jlmd.android.newfilmsmvp.domain.model.MovieDetails; import java.util.ArrayList; import java.util.List; /** * @author jlmd */ public class MovieDetailsMapper implements Mapper<MovieDetailsResult, MovieDetails> { @Override public MovieDetails map(MovieDetailsResult movieDetailsResult) { MovieDetails movieDetails = new MovieDetails(); movieDetails.setGenres(getGenresList(movieDetailsResult.getGenres())); movieDetails.setHomepage(movieDetailsResult.getHomepage()); return movieDetails; } private List<String> getGenresList(List<Genre> genres) { List<String> genresList = new ArrayList<String>(); for (Genre genre : genres) { genresList.add(genre.getName()); } return genresList; } }