RegisterANewCustomerFormImpl.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.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.load
* existing customers
* </p>
*/
public class RegisterANewCustomerFormImpl
implements Serializable, SearchAllCustomersForm
{
/**
* Default constructor
*/
public RegisterANewCustomerFormImpl()
{
}
// Action register-a-new-customer-load-existing-customers formFields
private Collection customers;
/**
* <p>
* TODO: Model Documentation for customers
* </p>
*
* @return customers <p>
TODO: Model Documentation for customers
</p>
*/
public Collection getCustomers()
{
return this.customers;
}
/**
* Keeps track of whether or not the value of customers has
* be populated at least once.
*/
private boolean customersSet = false;
/**
* Indicates whether or not the value for customers has been set at least
* once.
*
* @return true/false
*/
public boolean isCustomersSet()
{
return this.customersSet;
}
/**
* <p>
* TODO: Model Documentation for customers
* </p>
*
* @param customersIn <p>
TODO: Model Documentation for customers
</p>
*/
public void setCustomers(Collection customersIn)
{
this.customers = customersIn;
this.customersSet = true;
}
/**
* Stores the label/value pairs.
*/
private Collection<SelectItem> customersBackingList;
/**
* @return backingList Collection<SelectItem>
*/
public Collection<SelectItem> getCustomersBackingList()
{
return customersBackingList;
}
/**
* @param customersBackingListIn
*/
public void setCustomersBackingList(Collection<SelectItem> customersBackingListIn)
{
this.customersBackingList = customersBackingListIn;
}
@NotNull
private String name;
/**
* <p>
* Name of the customer
* </p>
*
* @return name <p>
Name of the customer
</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>
* Name of the customer
* </p>
*
* @param nameIn <p>
Name of the customer
</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;
}
private String customerNo;
/**
* <p>
* TODO: Model Documentation for customerNo
* </p>
*
* @return customerNo <p>
TODO: Model Documentation for customerNo
</p>
*/
public String getCustomerNo()
{
return this.customerNo;
}
/**
* Keeps track of whether or not the value of customerNo has
* be populated at least once.
*/
private boolean customerNoSet = false;
/**
* Indicates whether or not the value for customerNo has been set at least
* once.
*
* @return true/false
*/
public boolean isCustomerNoSet()
{
return this.customerNoSet;
}
/**
* <p>
* TODO: Model Documentation for customerNo
* </p>
*
* @param customerNoIn <p>
TODO: Model Documentation for customerNo
</p>
*/
public void setCustomerNo(String customerNoIn)
{
this.customerNo = StringUtils.trimToNull(customerNoIn);
this.customerNoSet = true;
}
/**
* Stores the label/value pairs.
*/
private Collection<SelectItem> customerNoBackingList;
/**
* @return backingList Collection<SelectItem>
*/
public Collection<SelectItem> getCustomerNoBackingList()
{
return customerNoBackingList;
}
/**
* @param customerNoBackingListIn
*/
public void setCustomerNoBackingList(Collection<SelectItem> customerNoBackingListIn)
{
this.customerNoBackingList = customerNoBackingListIn;
}
@NotNull
private String password;
/**
* <p>
* TODO: Model Documentation for password
* </p>
*
* @return password <p>
TODO: Model Documentation for password
</p>
*/
public String getPassword()
{
return this.password;
}
/**
* Keeps track of whether or not the value of password has
* be populated at least once.
*/
private boolean passwordSet = false;
/**
* Indicates whether or not the value for password has been set at least
* once.
*
* @return true/false
*/
public boolean isPasswordSet()
{
return this.passwordSet;
}
/**
* <p>
* TODO: Model Documentation for password
* </p>
*
* @param passwordIn <p>
TODO: Model Documentation for password
</p>
*/
public void setPassword(String passwordIn)
{
this.password = StringUtils.trimToNull(passwordIn);
this.passwordSet = true;
}
/**
* Stores the label/value pairs.
*/
private Collection<SelectItem> passwordBackingList;
/**
* @return backingList Collection<SelectItem>
*/
public Collection<SelectItem> getPasswordBackingList()
{
return passwordBackingList;
}
/**
* @param passwordBackingListIn
*/
public void setPasswordBackingList(Collection<SelectItem> passwordBackingListIn)
{
this.passwordBackingList = passwordBackingListIn;
}
/*
* 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.customersSet)
{
dest.put("customers",this.customers);
}
if(this.nameSet)
{
dest.put("name",this.name);
}
if(this.customerNoSet)
{
dest.put("customerNo",this.customerNo);
}
if(this.passwordSet)
{
dest.put("password",this.password);
}
return dest;
}
/*
* Fills this form using values of a Map
*
* @param source the source Map
*/
public RegisterANewCustomerFormImpl copyFrom(Map<String,Object> source)
{
if(source.containsKey("customers"))
{
this.setCustomers((Collection)ConvertUtils.convert(source.get("customers"),Collection.class));
}
if(source.containsKey("name"))
{
this.setName((String)ConvertUtils.convert(source.get("name"),String.class));
}
if(source.containsKey("customerNo"))
{
this.setCustomerNo((String)ConvertUtils.convert(source.get("customerNo"),String.class));
}
if(source.containsKey("password"))
{
this.setPassword((String)ConvertUtils.convert(source.get("password"),String.class));
}
return this;
}
/**
* The serial version UID of this class. Needed for serialization.
*/
private static final long serialVersionUID = -7733397193235945783L;
}