package com.vishnus1224.teamworkapidemo.mapper;

import com.vishnus1224.teamworkapidemo.model.LatestActivityModel;

import java.util.ArrayList;
import java.util.List;

import javax.inject.Inject;

import io.realm.RealmResults;

/**
 * Created by Vishnu on 8/29/2016.
 */
public class RealmResultToListMapper implements Mapper<RealmResults<LatestActivityModel>, List<LatestActivityModel>> {

    @Inject
    public RealmResultToListMapper() {

    }


    @Override
    public List<LatestActivityModel> map(RealmResults<LatestActivityModel> latestActivityModels) {

        List<LatestActivityModel> list = new ArrayList<>(latestActivityModels.size());

        list.addAll(latestActivityModels);

        return list;
    }
}

@@ -42,16 +42,80 @@
 apper;%0A%0A
+import com.vishnus1224.teamworkapidemo.model.LatestActivityDto;%0A
 import c
@@ -437,21 +437,19 @@
 Activity
-Model
+Dto
 %3E%3E %7B%0A%0A  
@@ -550,21 +550,19 @@
 Activity
-Model
+Dto
 %3E map(Re
@@ -645,21 +645,19 @@
 Activity
-Model
+Dto
 %3E list =
@@ -716,42 +716,2021 @@
     
-list.addAll(latestActivityModels);
+for(LatestActivityModel latestActivityModel : latestActivityModels)%7B%0A%0A            LatestActivityDto latestActivityDto = new LatestActivityDto();%0A%0A            latestActivityDto.projectId = latestActivityModel.projectId;%0A%0A            latestActivityDto.itemId = latestActivityModel.itemId;%0A%0A            latestActivityDto.fromUserAvatarUrl = latestActivityModel.fromUserAvatarUrl;%0A%0A            latestActivityDto.description = latestActivityModel.description;%0A%0A            latestActivityDto.forUsername = latestActivityModel.forUsername;%0A%0A            latestActivityDto.publicInfo = latestActivityModel.publicInfo;%0A%0A            latestActivityDto.forUserId = latestActivityModel.forUserId;%0A%0A            latestActivityDto.itemLink = latestActivityModel.itemLink;%0A%0A            latestActivityDto.dateTime = latestActivityModel.dateTime;%0A%0A            latestActivityDto.activityType = latestActivityModel.activityType;%0A%0A            latestActivityDto.companyId = latestActivityModel.companyId;%0A%0A            latestActivityDto.projectName = latestActivityModel.projectName;%0A%0A            latestActivityDto.latestActivityType = latestActivityModel.latestActivityType;%0A%0A            latestActivityDto.link = latestActivityModel.link;%0A%0A            latestActivityDto.extraDescription = latestActivityModel.extraDescription;%0A%0A            latestActivityDto.isPrivate = latestActivityModel.isPrivate;%0A%0A            latestActivityDto.companyName = latestActivityModel.companyName;%0A%0A            latestActivityDto.id = latestActivityModel.id;%0A%0A            latestActivityDto.dueDate = latestActivityModel.dueDate;%0A%0A            latestActivityDto.lockDownId = latestActivityModel.lockDownId;%0A%0A            latestActivityDto.fromUsername = latestActivityModel.fromUsername;%0A%0A            latestActivityDto.type = latestActivityModel.type;%0A%0A            latestActivityDto.forUserAvatarUrl = latestActivityModel.forUserAvatarUrl;%0A%0A            latestActivityDto.userId = latestActivityModel.userId;%0A%0A            list.add(latestActivityDto);%0A%0A        %7D
 %0A%0A  

set dto as the return type