ConfirmAnimalInMindGotOneFormImpl.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 org.apache.commons.beanutils.ConvertUtils;
import org.apache.commons.lang.StringUtils;

/**
 * <p>
 * Click to confirm you have an animal in mind.
 * </p>
 */
public class ConfirmAnimalInMindGotOneFormImpl
    implements Serializable, GetFirstQuestionForm
{
    /**
     * Default constructor
     */
    public ConfirmAnimalInMindGotOneFormImpl()
    {
    }

    // Action guess-got-one formFields
    private String question;

    /**
     * <p>
     * TODO: Model Documentation for question
     * </p>
     *
     * @return question <p>
TODO: Model Documentation for question
</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>
     * TODO: Model Documentation for question
     * </p>
     *
     * @param questionIn <p>
TODO: Model Documentation for question
</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 ConfirmAnimalInMindGotOneFormImpl 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 = -7817245890657422709L;
}