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.IDirectMessageForm;

@StrutsActionForm(name = "directMessageForm")
public class DirectMessageFormImpl implements IDirectMessageForm {
    FormatType formatType_;
    long directMessageId_;
    String foreignKey_;
    boolean sent_;
    String source_;
    boolean specified_;
    String text_;
    long userId_;
    
    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 getDirectMessageId() {
        return directMessageId_;
    }
    public void setDirectMessageId(long directMessageId) {
        directMessageId_ = directMessageId;
    }
    public String getForeignKey() {
        return foreignKey_ == null ? "" : foreignKey_;
    }
    public boolean isSent() {
        return sent_;
    }
    public void setSent(boolean sent) {
        sent_ = sent;
    }
    public String getSource() {
        return source_;
    }
    public boolean isSpecified() {
        return specified_;
    }
    public void setSpecified(boolean specified) {
        specified_ = specified;
    }
    public String getText() {
        return text_ == null ? "" : text_;
    }
    public void setForeignKey(String foreignKey) {
        foreignKey_ = foreignKey;
    }
    public void setSource(String source) {
        source_ = source;
    }
    public void setText(String text) {
        text_ = text;
    }
    public long getUserId() {
        return userId_;
    }
    public void setUserId(long userId) {
        userId_ = userId;
    }
    public String getUser() {
        return foreignKey_ == null ? "" : foreignKey_;
    }
    public void setUser(String user) {
        foreignKey_ = user;
    }
}
