package some;

import java.util.HashMap;
import java.util.Map;

import net.w_horse.excelpojo.annotation.Bean;
import net.w_horse.excelpojo.annotation.LabeledCell;
import net.w_horse.excelpojo.annotation.MappedCell;
import net.w_horse.excelpojo.xml.tag.RetrieveType;

@Bean(retrieveType=RetrieveType.VERTICAL_REPEATS,
		label="会員一覧２",
		terminate="Terminate",
		listClass="some.UserInfo4[]")
public class UserInfo4 {
	@LabeledCell(label = "ID")
	private int id;
	@LabeledCell(label = "性別", margedRows=true)
	private String gender;
	@LabeledCell(label = "氏名")
	private String firstName;
	@LabeledCell(label = "氏名",  margedLabel=1)
	private String lastName;
	@LabeledCell(label = "メールアドレス")
	private String mailAddress;
	@MappedCell(previousLabel="メールアドレス")
	private Map<String, Integer> workingHours = new HashMap<String, Integer>();

	public String toString() {
		StringBuffer buff = new StringBuffer("UserInfo\t");
		buff.append("id=" + String.valueOf(getId()) + ", ");
		buff.append("gender=" + getGender() + ", ");
		buff.append("firstName=" + getFirstName() + ", ");
		buff.append("lastName=" + getLastName());

		buff.append(" 作業時間 ");
		for (String month : workingHours.keySet()) {
			Object value = workingHours.get(month);
			buff.append(String.format(" %s=%s時間", month, value));
		}
		return buff.toString();
	}

	public void setId(int id) {
		this.id = id;
	}
	public int getId() {
		return id;
	}
	public void setGender(String gender) {
		this.gender = gender;
	}
	public String getGender() {
		return gender;
	}
	public void setFirstName(String firstName) {
		this.firstName = firstName;
	}
	public String getFirstName() {
		return firstName;
	}
	public void setLastName(String lastName) {
		this.lastName = lastName;
	}
	public String getLastName() {
		return lastName;
	}

	public void setWorkingHours(Map<String, Integer> workingHours) {
		this.workingHours = workingHours;
	}

	public Map<String, Integer> getWorkingHours() {
		return workingHours;
	}

	public void setMailAddress(String mailAddress) {
		this.mailAddress = mailAddress;
	}

	public String getMailAddress() {
		return mailAddress;
	}


}
