Search in sources :

Example 1 with ComicSeriesDetailsViewModel

use of com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesDetailsViewModel in project Rosie by Karumi.

the class ComicSeriesDetailsActivityTest method givenComicData.

private List<ComicSeriesDetailViewModel> givenComicData(ComicSeries comicSeries) {
    ComicSeriesToComicSeriesDetailsViewModelMapper mapper = new ComicSeriesToComicSeriesDetailsViewModelMapper();
    ComicSeriesDetailsViewModel comicSeriesDetailsViewModel = mapper.map(comicSeries);
    return comicSeriesDetailsViewModel.getComicSeriesDetailViewModels();
}
Also used : ComicSeriesDetailsViewModel(com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesDetailsViewModel) ComicSeriesToComicSeriesDetailsViewModelMapper(com.karumi.rosie.sample.comics.view.viewmodel.mapper.ComicSeriesToComicSeriesDetailsViewModelMapper)

Example 2 with ComicSeriesDetailsViewModel

use of com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesDetailsViewModel in project Rosie by Karumi.

the class ComicSeriesToComicSeriesDetailsViewModelMapper method map.

@Override
public ComicSeriesDetailsViewModel map(ComicSeries comicSeries) {
    ComicSeriesDetailsViewModel comicSeriesDetailsViewModel = new ComicSeriesDetailsViewModel();
    comicSeriesDetailsViewModel.setTitle(comicSeries.getName());
    List<ComicSeriesDetailViewModel> comicSeriesDetailViewModels = new LinkedList<>();
    comicSeriesDetailViewModels.add(mapComicSeriesToComicSeriesHeaderDetailViewModel(comicSeries));
    comicSeriesDetailViewModels.addAll(mapComicsToComicViewModels(comicSeries.getComics()));
    comicSeriesDetailsViewModel.setComicSeriesDetailViewModels(comicSeriesDetailViewModels);
    return comicSeriesDetailsViewModel;
}
Also used : ComicSeriesDetailsViewModel(com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesDetailsViewModel) ComicSeriesDetailViewModel(com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesDetailViewModel) LinkedList(java.util.LinkedList)

Aggregations

ComicSeriesDetailsViewModel (com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesDetailsViewModel)2 ComicSeriesDetailViewModel (com.karumi.rosie.sample.comics.view.viewmodel.ComicSeriesDetailViewModel)1 ComicSeriesToComicSeriesDetailsViewModelMapper (com.karumi.rosie.sample.comics.view.viewmodel.mapper.ComicSeriesToComicSeriesDetailsViewModelMapper)1 LinkedList (java.util.LinkedList)1