ChooseCarSelectCarFormImpl.java

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

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
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.contracts.web.handOut.Select car
 * </p>
 */
public class ChooseCarSelectCarFormImpl
    implements Serializable, SaveSelectedCarForm
{
    /**
     * Default constructor
     */
    public ChooseCarSelectCarFormImpl()
    {
    }

    // Action hand-out-car-select-car formFields
    private Date handOutDate;

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

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

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

    /**
     * <p>
     * TODO: Model Documentation for handOutDate
     * </p>
     *
     * @param handOutDateIn <p>
TODO: Model Documentation for handOutDate
</p>
     */
    public void setHandOutDate(Date handOutDateIn)
    {
        this.handOutDate = handOutDateIn;
        this.handOutDateSet = true;
    }

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


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getHandOutDateBackingList()
    {
        return handOutDateBackingList;
    }

    /**
     * @param handOutDateBackingListIn
     */
    public void setHandOutDateBackingList(Collection<SelectItem> handOutDateBackingListIn)
    {
        this.handOutDateBackingList = handOutDateBackingListIn;
    }
    

    private Date returnDate;

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

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

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

    /**
     * <p>
     * TODO: Model Documentation for returnDate
     * </p>
     *
     * @param returnDateIn <p>
TODO: Model Documentation for returnDate
</p>
     */
    public void setReturnDate(Date returnDateIn)
    {
        this.returnDate = returnDateIn;
        this.returnDateSet = true;
    }

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


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getReturnDateBackingList()
    {
        return returnDateBackingList;
    }

    /**
     * @param returnDateBackingListIn
     */
    public void setReturnDateBackingList(Collection<SelectItem> returnDateBackingListIn)
    {
        this.returnDateBackingList = returnDateBackingListIn;
    }
    

    private String id;

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

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

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

    /**
     * <p>
     * TODO: Model Documentation for id
     * </p>
     *
     * @param idIn <p>
TODO: Model Documentation for id
</p>
     */
    public void setId(String idIn)
    {
        this.id = StringUtils.trimToNull(idIn);
        this.idSet = true;
    }

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


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getIdBackingList()
    {
        return idBackingList;
    }

    /**
     * @param idBackingListIn
     */
    public void setIdBackingList(Collection<SelectItem> idBackingListIn)
    {
        this.idBackingList = idBackingListIn;
    }
    


    /*
     * 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.handOutDateSet)
        {
            dest.put("handOutDate",this.handOutDate);
        }
        if(this.returnDateSet)
        {
            dest.put("returnDate",this.returnDate);
        }
        if(this.idSet)
        {
            dest.put("id",this.id);
        }
        return dest;
    }

    /*
     * Fills this form using values of a Map
     *
     * @param source the source Map
     */     
     public ChooseCarSelectCarFormImpl copyFrom(Map<String,Object> source)
    {
        if(source.containsKey("handOutDate"))
        {
            this.setHandOutDate((Date)ConvertUtils.convert(source.get("handOutDate"),Date.class));
        }
        if(source.containsKey("returnDate"))
        {
            this.setReturnDate((Date)ConvertUtils.convert(source.get("returnDate"),Date.class));
        }
        if(source.containsKey("id"))
        {
            this.setId((String)ConvertUtils.convert(source.get("id"),String.class));
        }
        return this;
    }

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