CreateLicensedDriverSaveDriverFormImpl.java

// license-header java merge-point
// Generated by andromda-jsf cartridge (forms\FormImpl.java.vsl)
package org.andromda.samples.carrental.customers.web.registerCustomer;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import java.util.Map;
import javax.faces.model.SelectItem;
import javax.validation.constraints.NotNull;
import org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.lang.StringUtils;

/**
 * <p>
 * TODO: Model Documentation for org.andromda.samples.carrental.customers.web.registerCustomer.save
 * Driver
 * </p>
 */
public class CreateLicensedDriverSaveDriverFormImpl
    implements Serializable, SaveDriverForm, LoadExistingDriversForm
{
    /**
     * Default constructor
     */
    public CreateLicensedDriverSaveDriverFormImpl()
    {
    }

    // Action register-a-new-customer-save-driver formFields
    private Collection drivers;

    /**
     * <p>
     * TODO: Model Documentation for drivers
     * </p>
     *
     * @return drivers <p>
TODO: Model Documentation for drivers
</p>
     */
    public Collection getDrivers()
    {
        return this.drivers;
    }

    /**
     * Keeps track of whether or not the value of drivers has
     * be populated at least once.
     */
    private boolean driversSet = false;

    /**
     * Indicates whether or not the value for drivers has been set at least
     * once.
     *
     * @return true/false
     */
    public boolean isDriversSet()
    {
        return this.driversSet;
    }

    /**
     * <p>
     * TODO: Model Documentation for drivers
     * </p>
     *
     * @param driversIn <p>
TODO: Model Documentation for drivers
</p>
     */
    public void setDrivers(Collection driversIn)
    {
        this.drivers = driversIn;
        this.driversSet = true;
    }

    /**
     * Stores the label/value pairs.
     */
    private Collection<SelectItem> driversBackingList;


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getDriversBackingList()
    {
        return driversBackingList;
    }

    /**
     * @param driversBackingListIn
     */
    public void setDriversBackingList(Collection<SelectItem> driversBackingListIn)
    {
        this.driversBackingList = driversBackingListIn;
    }
    

    @NotNull
    private String name;

    /**
     * <p>
     * TODO: Model Documentation for name
     * </p>
     *
     * @return name <p>
TODO: Model Documentation for name
</p>
     */
    public String getName()
    {
        return this.name;
    }

    /**
     * Keeps track of whether or not the value of name has
     * be populated at least once.
     */
    private boolean nameSet = false;

    /**
     * Indicates whether or not the value for name has been set at least
     * once.
     *
     * @return true/false
     */
    public boolean isNameSet()
    {
        return this.nameSet;
    }

    /**
     * <p>
     * TODO: Model Documentation for name
     * </p>
     *
     * @param nameIn <p>
TODO: Model Documentation for name
</p>
     */
    public void setName(String nameIn)
    {
        this.name = StringUtils.trimToNull(nameIn);
        this.nameSet = true;
    }

    /**
     * Stores the label/value pairs.
     */
    private Collection<SelectItem> nameBackingList;


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getNameBackingList()
    {
        return nameBackingList;
    }

    /**
     * @param nameBackingListIn
     */
    public void setNameBackingList(Collection<SelectItem> nameBackingListIn)
    {
        this.nameBackingList = nameBackingListIn;
    }
    

    @NotNull
    private String surname;

    /**
     * <p>
     * TODO: Model Documentation for surname
     * </p>
     *
     * @return surname <p>
TODO: Model Documentation for surname
</p>
     */
    public String getSurname()
    {
        return this.surname;
    }

    /**
     * Keeps track of whether or not the value of surname has
     * be populated at least once.
     */
    private boolean surnameSet = false;

    /**
     * Indicates whether or not the value for surname has been set at least
     * once.
     *
     * @return true/false
     */
    public boolean isSurnameSet()
    {
        return this.surnameSet;
    }

    /**
     * <p>
     * TODO: Model Documentation for surname
     * </p>
     *
     * @param surnameIn <p>
TODO: Model Documentation for surname
</p>
     */
    public void setSurname(String surnameIn)
    {
        this.surname = StringUtils.trimToNull(surnameIn);
        this.surnameSet = true;
    }

    /**
     * Stores the label/value pairs.
     */
    private Collection<SelectItem> surnameBackingList;


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getSurnameBackingList()
    {
        return surnameBackingList;
    }

    /**
     * @param surnameBackingListIn
     */
    public void setSurnameBackingList(Collection<SelectItem> surnameBackingListIn)
    {
        this.surnameBackingList = surnameBackingListIn;
    }
    

    private String licenseNo;

    /**
     * <p>
     * TODO: Model Documentation for licenseNo
     * </p>
     *
     * @return licenseNo <p>
TODO: Model Documentation for licenseNo
</p>
     */
    public String getLicenseNo()
    {
        return this.licenseNo;
    }

    /**
     * Keeps track of whether or not the value of licenseNo has
     * be populated at least once.
     */
    private boolean licenseNoSet = false;

    /**
     * Indicates whether or not the value for licenseNo has been set at least
     * once.
     *
     * @return true/false
     */
    public boolean isLicenseNoSet()
    {
        return this.licenseNoSet;
    }

    /**
     * <p>
     * TODO: Model Documentation for licenseNo
     * </p>
     *
     * @param licenseNoIn <p>
TODO: Model Documentation for licenseNo
</p>
     */
    public void setLicenseNo(String licenseNoIn)
    {
        this.licenseNo = StringUtils.trimToNull(licenseNoIn);
        this.licenseNoSet = true;
    }

    /**
     * Stores the label/value pairs.
     */
    private Collection<SelectItem> licenseNoBackingList;


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getLicenseNoBackingList()
    {
        return licenseNoBackingList;
    }

    /**
     * @param licenseNoBackingListIn
     */
    public void setLicenseNoBackingList(Collection<SelectItem> licenseNoBackingListIn)
    {
        this.licenseNoBackingList = licenseNoBackingListIn;
    }
    

    private String licenseIssuedBy;

    /**
     * <p>
     * TODO: Model Documentation for licenseIssuedBy
     * </p>
     *
     * @return licenseIssuedBy <p>
TODO: Model Documentation for licenseIssuedBy
</p>
     */
    public String getLicenseIssuedBy()
    {
        return this.licenseIssuedBy;
    }

    /**
     * Keeps track of whether or not the value of licenseIssuedBy has
     * be populated at least once.
     */
    private boolean licenseIssuedBySet = false;

    /**
     * Indicates whether or not the value for licenseIssuedBy has been set at least
     * once.
     *
     * @return true/false
     */
    public boolean isLicenseIssuedBySet()
    {
        return this.licenseIssuedBySet;
    }

    /**
     * <p>
     * TODO: Model Documentation for licenseIssuedBy
     * </p>
     *
     * @param licenseIssuedByIn <p>
TODO: Model Documentation for licenseIssuedBy
</p>
     */
    public void setLicenseIssuedBy(String licenseIssuedByIn)
    {
        this.licenseIssuedBy = StringUtils.trimToNull(licenseIssuedByIn);
        this.licenseIssuedBySet = true;
    }

    /**
     * Stores the label/value pairs.
     */
    private Collection<SelectItem> licenseIssuedByBackingList;


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getLicenseIssuedByBackingList()
    {
        return licenseIssuedByBackingList;
    }

    /**
     * @param licenseIssuedByBackingListIn
     */
    public void setLicenseIssuedByBackingList(Collection<SelectItem> licenseIssuedByBackingListIn)
    {
        this.licenseIssuedByBackingList = licenseIssuedByBackingListIn;
    }
    

    private Date birthDate;

    /**
     * <p>
     * TODO: Model Documentation for birthDate
     * </p>
     *
     * @return birthDate <p>
TODO: Model Documentation for birthDate
</p>
     */
    public Date getBirthDate()
    {
        return this.birthDate;
    }

    /**
     * Keeps track of whether or not the value of birthDate has
     * be populated at least once.
     */
    private boolean birthDateSet = false;

    /**
     * Indicates whether or not the value for birthDate has been set at least
     * once.
     *
     * @return true/false
     */
    public boolean isBirthDateSet()
    {
        return this.birthDateSet;
    }

    /**
     * <p>
     * TODO: Model Documentation for birthDate
     * </p>
     *
     * @param birthDateIn <p>
TODO: Model Documentation for birthDate
</p>
     */
    public void setBirthDate(Date birthDateIn)
    {
        this.birthDate = birthDateIn;
        this.birthDateSet = true;
    }

    /**
     * Stores the label/value pairs.
     */
    private Collection<SelectItem> birthDateBackingList;


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getBirthDateBackingList()
    {
        return birthDateBackingList;
    }

    /**
     * @param birthDateBackingListIn
     */
    public void setBirthDateBackingList(Collection<SelectItem> birthDateBackingListIn)
    {
        this.birthDateBackingList = birthDateBackingListIn;
    }
    


    /*
     * Append this form's fields and values to a Map
     *
     * @param dest the destination Map
     */  
    public Map<String,Object> copyTo(Map<String,Object> dest)
    {
        if(this.driversSet)
        {
            dest.put("drivers",this.drivers);
        }
        if(this.nameSet)
        {
            dest.put("name",this.name);
        }
        if(this.surnameSet)
        {
            dest.put("surname",this.surname);
        }
        if(this.licenseNoSet)
        {
            dest.put("licenseNo",this.licenseNo);
        }
        if(this.licenseIssuedBySet)
        {
            dest.put("licenseIssuedBy",this.licenseIssuedBy);
        }
        if(this.birthDateSet)
        {
            dest.put("birthDate",this.birthDate);
        }
        return dest;
    }

    /*
     * Fills this form using values of a Map
     *
     * @param source the source Map
     */     
     public CreateLicensedDriverSaveDriverFormImpl copyFrom(Map<String,Object> source)
    {
        if(source.containsKey("drivers"))
        {
            this.setDrivers((Collection)ConvertUtils.convert(source.get("drivers"),Collection.class));
        }
        if(source.containsKey("name"))
        {
            this.setName((String)ConvertUtils.convert(source.get("name"),String.class));
        }
        if(source.containsKey("surname"))
        {
            this.setSurname((String)ConvertUtils.convert(source.get("surname"),String.class));
        }
        if(source.containsKey("licenseNo"))
        {
            this.setLicenseNo((String)ConvertUtils.convert(source.get("licenseNo"),String.class));
        }
        if(source.containsKey("licenseIssuedBy"))
        {
            this.setLicenseIssuedBy((String)ConvertUtils.convert(source.get("licenseIssuedBy"),String.class));
        }
        if(source.containsKey("birthDate"))
        {
            this.setBirthDate((Date)ConvertUtils.convert(source.get("birthDate"),Date.class));
        }
        return this;
    }

    /**
     * The serial version UID of this class. Needed for serialization.
     */
    private static final long serialVersionUID = 3809664724393293872L;
}