/**
*
*/
package com.cin.translators;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import com.cin.dto.EmploymentStatusDTO;
import com.cin.dto.OccupationDTO;
import com.cin.dto.StateAbbvDTO;
import com.cin.dto.UserDTO;
import com.cin.dto.ZipDTO;
import com.cin.entity.Employmentstat;
import com.cin.entity.Occupation;
import com.cin.entity.Stateabbv;
import com.cin.entity.Userrecord;
import com.cin.entity.Ziptable;
/**
* @author arunsanjay
*
*/
public class DataTranslator {
public List<UserDTO> translateToUserDTO(Collection<?> pUserEntity) {
List<UserDTO> theUserDTO = new ArrayList<UserDTO>();
UserDTO aDTO = null;
for(Object anUserrecord : pUserEntity) {
aDTO = new UserDTO((Userrecord)anUserrecord);
theUserDTO.add(aDTO);
}
return theUserDTO;
}
public List<StateAbbvDTO> translateToState(Collection<?> pStateEntity) {
List<StateAbbvDTO> theStates = new ArrayList<StateAbbvDTO>();
for(Object anEntity : pStateEntity) {
StateAbbvDTO stateDTO = new StateAbbvDTO((Stateabbv)anEntity);
theStates.add(stateDTO);
}
return theStates;
}
public List<OccupationDTO> translateToOccupationDTO(Collection<?> pOccupationEntity) {
List<OccupationDTO> theOccupationDTO = new ArrayList<OccupationDTO>();
OccupationDTO aDTO = null;
for(Object anOccupation : pOccupationEntity) {
aDTO = new OccupationDTO((Occupation)anOccupation);
theOccupationDTO.add(aDTO);
}
return theOccupationDTO;
}
public List<ZipDTO> translateToZipDTO(Collection<?> pZipEntity) {
List<ZipDTO> theZipDTO = new ArrayList<ZipDTO>();
ZipDTO aDTO = null;
for(Object aZiptable : pZipEntity) {
aDTO = new ZipDTO((Ziptable)aZiptable);
theZipDTO.add(aDTO);
}
return theZipDTO;
}
public List<EmploymentStatusDTO> translateToEmploymentStatusDTO(Collection<?> pEmploymentStatusEntity) {
List<EmploymentStatusDTO> theEmploymentStatusDTO = new ArrayList<EmploymentStatusDTO>();
EmploymentStatusDTO aDTO = null;
for(Object aEmploymentstat : pEmploymentStatusEntity) {
aDTO = new EmploymentStatusDTO((Employmentstat)aEmploymentstat);
theEmploymentStatusDTO.add(aDTO);
}
return theEmploymentStatusDTO;
}
}