All Downloads are FREE. Search and download functionalities are using the official Maven repository.

esendex.sdk.java.model.domain.impl.ContactResponseAssembler Maven / Gradle / Ivy

Go to download

The Esendex Java SDK is an easy to use client for our REST API that you can use to integrate SMS and Voice messaging into your Java application.

The newest version!
package esendex.sdk.java.model.domain.impl;

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

import esendex.sdk.java.model.domain.response.ContactResponse;
import esendex.sdk.java.model.transfer.contact.ContactCollectionDto;
import esendex.sdk.java.model.transfer.contact.ContactDto;

public class ContactResponseAssembler {
	
	public ContactResponse createResponse(ContactDto dto) {
		
		ContactResponseImpl resp = new ContactResponseImpl();
		
		resp.setFirstName(dto.getFirstname());
		resp.setId(dto.getId());
		resp.setConcurrencyId(dto.getConcurrencyid());
		resp.setLastName(dto.getLastname());
		resp.setMobileNumber(dto.getMobilenumber());
		resp.setQuickName(dto.getQuickname());
		resp.setType(dto.getType());
		
		return resp;
	}
	
	public List createCollectionResponse(ContactCollectionDto col) {
		
		List list = new ArrayList();
		if (col != null) {
			for (ContactDto dto : col.getContacts()) {
				list.add(createResponse(dto));
			}
		}
		return list;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy