RegisterNewCarCreateFormImpl.java

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

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

/**
 * <p>
 * TODO: Model Documentation for org.andromda.samples.carrental.inventory.web.registerCar.create
 * </p>
 */
public class RegisterNewCarCreateFormImpl
    implements Serializable, CreateCarForm
{
    /**
     * Default constructor
     */
    public RegisterNewCarCreateFormImpl()
    {
    }

    // Action register-car-create formFields
    private String inventoryNo;

    /**
     * <p>
     * Inventory Number (Must be unique)
     * </p>
     *
     * @return inventoryNo <p>
Inventory Number (Must be unique)
</p>
     */
    public String getInventoryNo()
    {
        return this.inventoryNo;
    }

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

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

    /**
     * <p>
     * Inventory Number (Must be unique)
     * </p>
     *
     * @param inventoryNoIn <p>
Inventory Number (Must be unique)
</p>
     */
    public void setInventoryNo(String inventoryNoIn)
    {
        this.inventoryNo = StringUtils.trimToNull(inventoryNoIn);
        this.inventoryNoSet = true;
    }

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


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getInventoryNoBackingList()
    {
        return inventoryNoBackingList;
    }

    /**
     * @param inventoryNoBackingListIn
     */
    public void setInventoryNoBackingList(Collection<SelectItem> inventoryNoBackingListIn)
    {
        this.inventoryNoBackingList = inventoryNoBackingListIn;
    }
    

    private String registrationNo;

    /**
     * <p>
     * Registration Number (Must be unique)
     * </p>
     *
     * @return registrationNo <p>
Registration Number (Must be unique)
</p>
     */
    public String getRegistrationNo()
    {
        return this.registrationNo;
    }

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

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

    /**
     * <p>
     * Registration Number (Must be unique)
     * </p>
     *
     * @param registrationNoIn <p>
Registration Number (Must be unique)
</p>
     */
    public void setRegistrationNo(String registrationNoIn)
    {
        this.registrationNo = StringUtils.trimToNull(registrationNoIn);
        this.registrationNoSet = true;
    }

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


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getRegistrationNoBackingList()
    {
        return registrationNoBackingList;
    }

    /**
     * @param registrationNoBackingListIn
     */
    public void setRegistrationNoBackingList(Collection<SelectItem> registrationNoBackingListIn)
    {
        this.registrationNoBackingList = registrationNoBackingListIn;
    }
    

    private String carTypeId;

    /**
     * <p>
     * Select one car type form the list which corresponds with the comfort class
     * </p>
     *
     * @return carTypeId <p>
Select one car type form the list which corresponds with the comfort class
</p>
     */
    public String getCarTypeId()
    {
        return this.carTypeId;
    }

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

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

    /**
     * <p>
     * Select one car type form the list which corresponds with the comfort class
     * </p>
     *
     * @param carTypeIdIn <p>
Select one car type form the list which corresponds with the comfort class
</p>
     */
    public void setCarTypeId(String carTypeIdIn)
    {
        this.carTypeId = StringUtils.trimToNull(carTypeIdIn);
        this.carTypeIdSet = true;
    }

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


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getCarTypeIdBackingList()
    {
        return carTypeIdBackingList;
    }

    /**
     * @param carTypeIdBackingListIn
     */
    public void setCarTypeIdBackingList(Collection<SelectItem> carTypeIdBackingListIn)
    {
        this.carTypeIdBackingList = carTypeIdBackingListIn;
    }
    


    /*
     * 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.inventoryNoSet)
        {
            dest.put("inventoryNo",this.inventoryNo);
        }
        if(this.registrationNoSet)
        {
            dest.put("registrationNo",this.registrationNo);
        }
        if(this.carTypeIdSet)
        {
            dest.put("carTypeId",this.carTypeId);
        }
        return dest;
    }

    /*
     * Fills this form using values of a Map
     *
     * @param source the source Map
     */     
     public RegisterNewCarCreateFormImpl copyFrom(Map<String,Object> source)
    {
        if(source.containsKey("inventoryNo"))
        {
            this.setInventoryNo((String)ConvertUtils.convert(source.get("inventoryNo"),String.class));
        }
        if(source.containsKey("registrationNo"))
        {
            this.setRegistrationNo((String)ConvertUtils.convert(source.get("registrationNo"),String.class));
        }
        if(source.containsKey("carTypeId"))
        {
            this.setCarTypeId((String)ConvertUtils.convert(source.get("carTypeId"),String.class));
        }
        return this;
    }

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