SelectContractReturnFormImpl.java
// license-header java merge-point
// Generated by andromda-jsf cartridge (forms\FormImpl.java.vsl)
package org.andromda.samples.carrental.contracts.web.returnCar;
import java.io.Serializable;
import java.util.Collection;
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.contracts.web.returnCar.return
* </p>
*/
public class SelectContractReturnFormImpl
implements Serializable, ReturnCarForm, HadAccidentForm
{
/**
* Default constructor
*/
public SelectContractReturnFormImpl()
{
}
// Action return-acar-return formFields
private String id;
/**
* <p>
* The contract number
* </p>
*
* @return id <p>
The contract number
</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>
* The contract number
* </p>
*
* @param idIn <p>
The contract number
</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;
}
@NotNull
private boolean accidentHappend;
/**
* <p>
* TODO: Model Documentation for accidentHappend
* </p>
*
* @return accidentHappend <p>
TODO: Model Documentation for accidentHappend
</p>
*/
public boolean isAccidentHappend()
{
return this.accidentHappend;
}
public boolean getAccidentHappend()
{
return this.accidentHappend;
}
/**
* Keeps track of whether or not the value of accidentHappend has
* be populated at least once.
*/
private boolean accidentHappendSet = false;
/**
* Indicates whether or not the value for accidentHappend has been set at least
* once.
*
* @return true/false
*/
public boolean isAccidentHappendSet()
{
return this.accidentHappendSet;
}
/**
* <p>
* TODO: Model Documentation for accidentHappend
* </p>
*
* @param accidentHappendIn <p>
TODO: Model Documentation for accidentHappend
</p>
*/
public void setAccidentHappend(boolean accidentHappendIn)
{
this.accidentHappend = accidentHappendIn;
this.accidentHappendSet = true;
}
/**
* Stores the label/value pairs.
*/
private Collection<SelectItem> accidentHappendBackingList;
/**
* @return backingList Collection<SelectItem>
*/
public Collection<SelectItem> getAccidentHappendBackingList()
{
return accidentHappendBackingList;
}
/**
* @param accidentHappendBackingListIn
*/
public void setAccidentHappendBackingList(Collection<SelectItem> accidentHappendBackingListIn)
{
this.accidentHappendBackingList = accidentHappendBackingListIn;
}
/*
* 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.idSet)
{
dest.put("id",this.id);
}
if(this.accidentHappendSet)
{
dest.put("accidentHappend",this.accidentHappend);
}
return dest;
}
/*
* Fills this form using values of a Map
*
* @param source the source Map
*/
public SelectContractReturnFormImpl copyFrom(Map<String,Object> source)
{
if(source.containsKey("id"))
{
this.setId((String)ConvertUtils.convert(source.get("id"),String.class));
}
if(source.containsKey("accidentHappend"))
{
this.setAccidentHappend((Boolean)ConvertUtils.convert(source.get("accidentHappend"),Boolean.class));
}
return this;
}
/**
* The serial version UID of this class. Needed for serialization.
*/
private static final long serialVersionUID = -582259248123084291L;
}