ReserveACarReserveFormImpl.java
// license-header java merge-point
// Generated by andromda-jsf cartridge (forms\FormImpl.java.vsl)
package org.andromda.samples.carrental.contracts.web.reserveCar;
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>
* Click to reserve make the reservation with the data specified
* </p>
*/
public class ReserveACarReserveFormImpl
implements Serializable, ReserveForm
{
/**
* Default constructor
*/
public ReserveACarReserveFormImpl()
{
}
// Action customer-reserves-car-reserve formFields
private String comfortClass;
/**
* <p>
* Comfort Class of the car
* </p>
*
* @return comfortClass <p>
Comfort Class of the car
</p>
*/
public String getComfortClass()
{
return this.comfortClass;
}
/**
* Keeps track of whether or not the value of comfortClass has
* be populated at least once.
*/
private boolean comfortClassSet = false;
/**
* Indicates whether or not the value for comfortClass has been set at least
* once.
*
* @return true/false
*/
public boolean isComfortClassSet()
{
return this.comfortClassSet;
}
/**
* <p>
* Comfort Class of the car
* </p>
*
* @param comfortClassIn <p>
Comfort Class of the car
</p>
*/
public void setComfortClass(String comfortClassIn)
{
this.comfortClass = StringUtils.trimToNull(comfortClassIn);
this.comfortClassSet = true;
}
/**
* Stores the label/value pairs.
*/
private Collection<SelectItem> comfortClassBackingList;
/**
* @return backingList Collection<SelectItem>
*/
public Collection<SelectItem> getComfortClassBackingList()
{
return comfortClassBackingList;
}
/**
* @param comfortClassBackingListIn
*/
public void setComfortClassBackingList(Collection<SelectItem> comfortClassBackingListIn)
{
this.comfortClassBackingList = comfortClassBackingListIn;
}
private Date reservationDate;
/**
* <p>
* Day to pick up the car
* </p>
*
* @return reservationDate <p>
Day to pick up the car
</p>
*/
public Date getReservationDate()
{
return this.reservationDate;
}
/**
* Keeps track of whether or not the value of reservationDate has
* be populated at least once.
*/
private boolean reservationDateSet = false;
/**
* Indicates whether or not the value for reservationDate has been set at least
* once.
*
* @return true/false
*/
public boolean isReservationDateSet()
{
return this.reservationDateSet;
}
/**
* <p>
* Day to pick up the car
* </p>
*
* @param reservationDateIn <p>
Day to pick up the car
</p>
*/
public void setReservationDate(Date reservationDateIn)
{
this.reservationDate = reservationDateIn;
this.reservationDateSet = true;
}
/**
* Stores the label/value pairs.
*/
private Collection<SelectItem> reservationDateBackingList;
/**
* @return backingList Collection<SelectItem>
*/
public Collection<SelectItem> getReservationDateBackingList()
{
return reservationDateBackingList;
}
/**
* @param reservationDateBackingListIn
*/
public void setReservationDateBackingList(Collection<SelectItem> reservationDateBackingListIn)
{
this.reservationDateBackingList = reservationDateBackingListIn;
}
/*
* 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.comfortClassSet)
{
dest.put("comfortClass",this.comfortClass);
}
if(this.reservationDateSet)
{
dest.put("reservationDate",this.reservationDate);
}
return dest;
}
/*
* Fills this form using values of a Map
*
* @param source the source Map
*/
public ReserveACarReserveFormImpl copyFrom(Map<String,Object> source)
{
if(source.containsKey("comfortClass"))
{
this.setComfortClass((String)ConvertUtils.convert(source.get("comfortClass"),String.class));
}
if(source.containsKey("reservationDate"))
{
this.setReservationDate((Date)ConvertUtils.convert(source.get("reservationDate"),Date.class));
}
return this;
}
/**
* The serial version UID of this class. Needed for serialization.
*/
private static final long serialVersionUID = 1788595709386057187L;
}