package com.cygnusa.hyperm.wrappers;

import java.util.ArrayList;

public class DSE {

    private String userid;
    private String fname;
    private String lname;
    private String smpin;
    private String dealer_code;
    private String dealer_name;
    private String segment;
    private String segment_str;
    private String profile;
    private ArrayList<TimeTaken> timerlist;

    public String getUserid() {
        return userid;
    }

    public void setUserid(String userid) {
        this.userid = userid;
    }

    public String getFname() {
        return fname;
    }

    public void setFname(String fname) {
        this.fname = fname;
    }

    public String getLname() {
        return lname;
    }

    public void setLname(String lname) {
        this.lname = lname;
    }

    public String getSmpin() {
        return smpin;
    }

    public void setSmpin(String smpin) {
        this.smpin = smpin;
    }

    public String getDealer_code() {
        return dealer_code;
    }

    public void setDealer_code(String dealer_code) {
        this.dealer_code = dealer_code;
    }

    public String getDealer_name() {
        return dealer_name;
    }

    public void setDealer_name(String dealer_name) {
        this.dealer_name = dealer_name;
    }

    public String getSegment() {
        return segment;
    }

    public void setSegment(String segment) {
        this.segment = segment;
    }

    public String getSegment_str() {
        return segment_str;
    }

    public void setSegment_str(String segment_str) {
        this.segment_str = segment_str;
    }

    public ArrayList<TimeTaken> getTimerlist() {
        return timerlist == null ? new ArrayList<>() : timerlist;
    }

    public void setTimerlist(ArrayList<TimeTaken> timerlist) {
        this.timerlist = timerlist;
    }

    public boolean isActive() {
        if (timerlist.size() > 0) {
            return timerlist.get(timerlist.size() - 1).isActive();
        } else {
            return false;
        }
    }

    public String getProfile() {
        return profile == null ? "" : profile.trim();
    }

    public void setProfile(String profile) {
        this.profile = profile;
    }

    public String getName() {
        return smpin + "-" + (fname == null || fname.trim().isEmpty() ? "" : fname.trim()) + " "
                + (lname == null || lname.trim().isEmpty() ? "" : lname.trim());
    }

    public String getFullName() {
        return (fname == null || fname.trim().isEmpty() ? "" : fname.trim()) + " "
                + (lname == null || lname.trim().isEmpty() ? "" : lname.trim());
    }

}
