EnterAQuestionThisIsTheQuestionFormImpl.java
// license-header java merge-point
// Generated by andromda-jsf cartridge (forms\FormImpl.java.vsl)
package org.andromda.samples.animalquiz.guess;
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>
* Enter a differentiator question indicating the difference between the last animal and the one you
* had in mind.
* </p>
*/
public class EnterAQuestionThisIsTheQuestionFormImpl
implements Serializable, RememberQuestionForm
{
/**
* Default constructor
*/
public EnterAQuestionThisIsTheQuestionFormImpl()
{
}
// Action guess-this-is-the-question formFields
@NotNull
private String question;
/**
* <p>
* This question expresses the difference between the last guessed animal and the one the user
* actually had in mind.
* </p>
*
* @return question <p>
This question expresses the difference between the last guessed animal and the one the user actually
had in mind.
</p>
*/
public String getQuestion()
{
return this.question;
}
/**
* Keeps track of whether or not the value of question has
* be populated at least once.
*/
private boolean questionSet = false;
/**
* Indicates whether or not the value for question has been set at least
* once.
*
* @return true/false
*/
public boolean isQuestionSet()
{
return this.questionSet;
}
/**
* <p>
* This question expresses the difference between the last guessed animal and the one the user
* actually had in mind.
* </p>
*
* @param questionIn <p>
This question expresses the difference between the last guessed animal and the one the user actually
had in mind.
</p>
*/
public void setQuestion(String questionIn)
{
this.question = StringUtils.trimToNull(questionIn);
this.questionSet = true;
}
/**
* Stores the label/value pairs.
*/
private Collection<SelectItem> questionBackingList;
/**
* @return backingList Collection<SelectItem>
*/
public Collection<SelectItem> getQuestionBackingList()
{
return questionBackingList;
}
/**
* @param questionBackingListIn
*/
public void setQuestionBackingList(Collection<SelectItem> questionBackingListIn)
{
this.questionBackingList = questionBackingListIn;
}
/*
* 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.questionSet)
{
dest.put("question",this.question);
}
return dest;
}
/*
* Fills this form using values of a Map
*
* @param source the source Map
*/
public EnterAQuestionThisIsTheQuestionFormImpl copyFrom(Map<String,Object> source)
{
if(source.containsKey("question"))
{
this.setQuestion((String)ConvertUtils.convert(source.get("question"),String.class));
}
return this;
}
/**
* The serial version UID of this class. Needed for serialization.
*/
private static final long serialVersionUID = -106052909344842681L;
}