PurchaseItemsFormImpl.java

// license-header java merge-point
// Generated by andromda-jsf cartridge (forms\FormImpl.java.vsl)
package my.onlinestore.purchase;

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;
import org.apache.myfaces.extensions.validator.baseval.annotation.Pattern;

/**
 * <p>
 * TODO: Model Documentation for my.onlinestore.purchase.prompt user for name and password
 * </p>
 */
public class PurchaseItemsFormImpl
    implements Serializable, LoadLanguagesForm
{
    /**
     * Default constructor
     */
    public PurchaseItemsFormImpl()
    {
    }

    // Action purchase-items-prompt-user-for-name-and-password formFields
    private String id;

    /**
     * <p>
     * TODO: Model Documentation for id
     * </p>
     *
     * @return id <p>
TODO: Model Documentation for id
</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>
     * TODO: Model Documentation for id
     * </p>
     *
     * @param idIn <p>
TODO: Model Documentation for id
</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;
    }
    

    private String publisher;

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

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

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

    /**
     * <p>
     * TODO: Model Documentation for publisher
     * </p>
     *
     * @param publisherIn <p>
TODO: Model Documentation for publisher
</p>
     */
    public void setPublisher(String publisherIn)
    {
        this.publisher = StringUtils.trimToNull(publisherIn);
        this.publisherSet = true;
    }

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


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getPublisherBackingList()
    {
        return publisherBackingList;
    }

    /**
     * @param publisherBackingListIn
     */
    public void setPublisherBackingList(Collection<SelectItem> publisherBackingListIn)
    {
        this.publisherBackingList = publisherBackingListIn;
    }
    

    @NotNull
    @Pattern("^[a-zA-Z]{3,}$")
    private String name;

    /**
     * <p>
     * This name is required and must consist of at least three alphabetical characters
     * </p>
     *
     * @return name <p>
This name is required and must consist of at least three alphabetical characters
</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>
     * This name is required and must consist of at least three alphabetical characters
     * </p>
     *
     * @param nameIn <p>
This name is required and must consist of at least three alphabetical characters
</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;
    }
    

    @Pattern("^[a-zA-Z0-9]{6,}$")
    @NotNull
    private String password;

    /**
     * <p>
     * This password is required and must consist of at least six alphanumerical characters, the
     * characters you type will be hidden behind a '*' (asterisk).
     * </p>
     *
     * @return password <p>
This password is required and must consist of at least six alphanumerical characters, the characters
you type will be hidden behind a '*' (asterisk).
</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>
     * This password is required and must consist of at least six alphanumerical characters, the
     * characters you type will be hidden behind a '*' (asterisk).
     * </p>
     *
     * @param passwordIn <p>
This password is required and must consist of at least six alphanumerical characters, the characters
you type will be hidden behind a '*' (asterisk).
</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;
    }
    

    
    @NotNull
    private String confirmPassword;

    /**
     * <p>
     * This field's value should match the one from the password field. This field is present to
     * show that AndroMDA can render the proper conditional validation routines.
     * </p>
     *
     * @return confirmPassword <p>
This field's value should match the one from the password field. This field is present to show that
AndroMDA can render the proper conditional validation routines.
</p>
     */
    public String getConfirmPassword()
    {
        return this.confirmPassword;
    }

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

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

    /**
     * <p>
     * This field's value should match the one from the password field. This field is present to
     * show that AndroMDA can render the proper conditional validation routines.
     * </p>
     *
     * @param confirmPasswordIn <p>
This field's value should match the one from the password field. This field is present to show that
AndroMDA can render the proper conditional validation routines.
</p>
     */
    public void setConfirmPassword(String confirmPasswordIn)
    {
        this.confirmPassword = StringUtils.trimToNull(confirmPasswordIn);
        this.confirmPasswordSet = true;
    }

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


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getConfirmPasswordBackingList()
    {
        return confirmPasswordBackingList;
    }

    /**
     * @param confirmPasswordBackingListIn
     */
    public void setConfirmPasswordBackingList(Collection<SelectItem> confirmPasswordBackingListIn)
    {
        this.confirmPasswordBackingList = confirmPasswordBackingListIn;
    }
    

    private String language;

    /**
     * <p>
     * Select the language in which to continue.
     * </p>
     *
     * @return language <p>
Select the language in which to continue.
</p>
     */
    public String getLanguage()
    {
        return this.language;
    }

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

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

    /**
     * <p>
     * Select the language in which to continue.
     * </p>
     *
     * @param languageIn <p>
Select the language in which to continue.
</p>
     */
    public void setLanguage(String languageIn)
    {
        this.language = StringUtils.trimToNull(languageIn);
        this.languageSet = true;
    }

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


    /**
     * @return backingList Collection<SelectItem>
     */
    public Collection<SelectItem> getLanguageBackingList()
    {
        return languageBackingList;
    }

    /**
     * @param languageBackingListIn
     */
    public void setLanguageBackingList(Collection<SelectItem> languageBackingListIn)
    {
        this.languageBackingList = languageBackingListIn;
    }
    


    /*
     * 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.publisherSet)
        {
            dest.put("publisher",this.publisher);
        }
        if(this.nameSet)
        {
            dest.put("name",this.name);
        }
        if(this.passwordSet)
        {
            dest.put("password",this.password);
        }
        if(this.confirmPasswordSet)
        {
            dest.put("confirmPassword",this.confirmPassword);
        }
        if(this.languageSet)
        {
            dest.put("language",this.language);
        }
        return dest;
    }

    /*
     * Fills this form using values of a Map
     *
     * @param source the source Map
     */     
     public PurchaseItemsFormImpl copyFrom(Map<String,Object> source)
    {
        if(source.containsKey("id"))
        {
            this.setId((String)ConvertUtils.convert(source.get("id"),String.class));
        }
        if(source.containsKey("publisher"))
        {
            this.setPublisher((String)ConvertUtils.convert(source.get("publisher"),String.class));
        }
        if(source.containsKey("name"))
        {
            this.setName((String)ConvertUtils.convert(source.get("name"),String.class));
        }
        if(source.containsKey("password"))
        {
            this.setPassword((String)ConvertUtils.convert(source.get("password"),String.class));
        }
        if(source.containsKey("confirmPassword"))
        {
            this.setConfirmPassword((String)ConvertUtils.convert(source.get("confirmPassword"),String.class));
        }
        if(source.containsKey("language"))
        {
            this.setLanguage((String)ConvertUtils.convert(source.get("language"),String.class));
        }
        return this;
    }

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