AnswerQuestionYesFormImpl.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>
 * Click here if the answer is correct.
 * </p>
 */
public class AnswerQuestionYesFormImpl
    implements Serializable, NextDecisionItemAvailableForm
{
    /**
     * Default constructor
     */
    public AnswerQuestionYesFormImpl()
    {
    }

    // Action guess-yes 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;
    }
    

    @NotNull
    private String animal;

    /**
     * <p>
     * TODO: Model Documentation for animal
     * </p>
     *
     * @return animal <p>
TODO: Model Documentation for animal
</p>
     */
    public String getAnimal()
    {
        return this.animal;
    }

    /**
     * Keeps track of whether or not the value of animal has
     * be populated at least once.
     */
    private boolean animalSet = false;

    /**
     * Indicates whether or not the value for animal has been set at least
     * once.
     *
     * @return true/false
     */
    public boolean isAnimalSet()
    {
        return this.animalSet;
    }

    /**
     * <p>
     * TODO: Model Documentation for animal
     * </p>
     *
     * @param animalIn <p>
TODO: Model Documentation for animal
</p>
     */
    public void setAnimal(String animalIn)
    {
        this.animal = StringUtils.trimToNull(animalIn);
        this.animalSet = true;
    }

    /**
     * Stores the label/value pairs.
     */
    private Collection<SelectItem> animalBackingList;


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getAnimalBackingList()
    {
        return animalBackingList;
    }

    /**
     * @param animalBackingListIn
     */
    public void setAnimalBackingList(Collection<SelectItem> animalBackingListIn)
    {
        this.animalBackingList = animalBackingListIn;
    }
    


    /*
     * 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);
        }
        if(this.animalSet)
        {
            dest.put("animal",this.animal);
        }
        return dest;
    }

    /*
     * Fills this form using values of a Map
     *
     * @param source the source Map
     */     
     public AnswerQuestionYesFormImpl copyFrom(Map<String,Object> source)
    {
        if(source.containsKey("question"))
        {
            this.setQuestion((String)ConvertUtils.convert(source.get("question"),String.class));
        }
        if(source.containsKey("animal"))
        {
            this.setAnimal((String)ConvertUtils.convert(source.get("animal"),String.class));
        }
        return this;
    }

    /**
     * The serial version UID of this class. Needed for serialization.
     */
    private static final long serialVersionUID = -9014927553756727885L;
}