package jp.sourceforge.shovel.form.impl;

import static jp.sourceforge.shovel.FormatType.*;

import org.seasar.struts.annotation.tiger.StrutsActionForm;

import jp.sourceforge.shovel.FormatType;
import jp.sourceforge.shovel.form.IUserForm;

@StrutsActionForm(name = "userForm")
public class UserFormImpl implements IUserForm {
    String email_;
    FormatType formatType_;
    long userId_;
    String foreignKey_;
    
    public String getEmail() {
        return email_ == null ? "" : email_;
    }
    public void setEmail(String email) {
        email_ = email;
    }
    public String getFormat() {
        return getFormatType().getId();
    }
    public void setFormat(String format) {
        setFormatType(FormatType.find(format));
    }
    public FormatType getFormatType() {
        return formatType_ == null ? HTML : formatType_;
    }
    public void setFormatType(FormatType formatType) {
        formatType_ = formatType;
    }
    public long getUserId() {
        return userId_;
    }
    public void setUserId(long userId) {
        userId_ = userId;
    }
    public String getForeignKey() {
        return foreignKey_ == null ? "" : foreignKey_;
    }
    public void setForeignKey(String foreignKey) {
        foreignKey_ = foreignKey;
    }
}
