/*
 * MosP - Mind Open Source Project    http://www.mosp.jp/
 * Copyright (C) MIND Co., Ltd.       http://www.e-mind.co.jp/
 * 
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 * 
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 */
package jp.mosp.common.common;

import java.io.Serializable;
import java.util.Date;

/**
 *  Dtoの基本機能を提供する。<br><br>
 *  作成者、作成日、更新者、更新日フィールドとそのアクセサメソッドを有する。<br>
 */
public class BaseDto implements Serializable {
	
	private static final long serialVersionUID = 5697604395699134118L;
	
	// フィールド
	private Date   insertDate;
	private String insertUser;
	private Date   updateDate;
	private String updateUser;
	
	/**
	 * コンストラクタ。<br>
	 */
	public BaseDto(){
		/* 処理無し */
	}
	
	// アクセサメソッド
	/**
	 * 作成日取得。<br>
	 * @return 作成日
	 */
	public Date getInsertDate() { return (Date)insertDate.clone(); }
	
	/**
	 * 作成日設定。<br>
	 * @param insertDate 作成日
	 */
	public void setInsertDate(Date insertDate) { this.insertDate = (Date)insertDate.clone(); }
	
	/**
	 * 作成者取得。<br>
	 * @return 作成者
	 */
	public String getInsertUser() { return insertUser; }
	
	/**
	 * 作成者設定。<br>
	 * @param insertUser 作成者
	 */
	public void setInsertUser(String insertUser) { this.insertUser = insertUser; }
	
	/**
	 * 更新日取得。<br>
	 * @return 更新日
	 */
	public Date getUpdateDate() { return (Date)updateDate.clone(); }
	
	/**
	 * 更新日設定。<br>
	 * @param updateDate 更新日
	 */
	public void setUpdateDate(Date updateDate) { this.updateDate = (Date)updateDate.clone(); }
	
	/**
	 * 更新者取得。<br>
	 * @return 更新者
	 */
	public String getUpdateUser() { return updateUser; }
	
	/**
	 * 更新者設定。<br>
	 * @param updateUser 更新者
	 */
	public void setUpdateUser(String updateUser) { this.updateUser = updateUser; }
	
	/**
	 * 日付フィールド取得。<br>
	 * @throws Exception
	 */
	protected Date getDateField(Date dateField) {
		return dateField == null ? null : (Date)dateField.clone();
	}

}
