package addressbook;

import java.net.*;

public class ParamBean {
	
	String sword = ""; // 検索ワード
	String id = ""; // アイテムのid
	
	public ParamBean(){
		
	}
	
	/**
	 * 検索ワードを取得
	 * @return 検索ワード
	 */
	public String getSword(){
	    return this.sword;
	}

	/**
	 * 検索ワードを設定
	 * @param sword
	 */
	public void setSword(String sword){
		this.sword = sword;		
	}

	/**
	 * パラメータidを取得
	 * @return id
	 */
	public String getId(){
	    return this.id;
	}

	/**
	 * パラメータidを設定
	 * @param id
	 */
	public void setId(String id){
		this.id = id;		
	}

	/**
	 * URLエンコードされた検索ワードを取得
	 * @return 検索ワード
	 */
	public String getEncSword() {

		String encSword = "";
		try {
			encSword = URLEncoder.encode(this.sword, "SHIFT-JIS");
		} catch (Exception e) {
	        System.out.println("文字のURLエンコードに失敗しました:" + e); 
		}
		return encSword;
	}	
}

