Subversion Repositories SmartDukaan

Rev

Rev 4793 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

/**
 * 
 */
package in.shop2020.crm.domain;

/**
 * Domain class for Agents in CRM.
 *
 * @author mandeep
 */
public class Agent {
    private long   id;
    private String emailId;
    private String password;
    private String name;
    private long   managerId;

    /**
     * Converts our domain model object from its thrift object representation.
     * @param tAgent
     * @return
     */
    public static Agent create(in.shop2020.crm.Agent tAgent)
    {
        Agent agent = new Agent();
        agent.id = tAgent.getId();
        agent.name = tAgent.getName();
        agent.emailId = tAgent.getEmailId();
        agent.managerId = tAgent.getManagerId();
        agent.password = tAgent.getPassword();
        return agent;
    }

    /**
     * Converts this model object to corresponding thrift object representation.
     *
     * @return
     */
    public in.shop2020.crm.Agent getThriftAgent() {
        in.shop2020.crm.Agent tAgent = new in.shop2020.crm.Agent();
        tAgent.setEmailId(emailId);
        tAgent.setId(id);
        tAgent.setName(name);
        tAgent.setManagerId(managerId);
        tAgent.setPassword(password);
        return tAgent;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getEmailId() {
        return emailId;
    }

    public void setEmailId(String emailId) {
        this.emailId = emailId;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public long getManagerId() {
        return managerId;
    }

    public void setManagerId(long managerId) {
        this.managerId = managerId;
    }
}