package tutorial.rest.resources.asm;

import org.springframework.hateoas.mvc.ResourceAssemblerSupport;
import tutorial.core.models.entities.EmailDomain;
import tutorial.rest.mvc.EmailDomainController;
import tutorial.rest.resources.EmailDomainResource;

/**
 * 
 * @author Xavier
 */
public class EmailDomainResourceAsm extends ResourceAssemblerSupport<EmailDomain, EmailDomainResource> {

    /**
     *
     */
    public EmailDomainResourceAsm() {
        super(EmailDomainController.class, EmailDomainResource.class);
    }

    /**
     *
     * @param emailDomain
     * @return
     */
    @Override
    public EmailDomainResource toResource(EmailDomain emailDomain) {
        EmailDomainResource res = new EmailDomainResource();
        res.setEmailDomainText(emailDomain.getEmailDomainText());
        return res;
    }
}
