package com.goafanti.portal.bo;


import java.util.Date;

import com.goafanti.achievement.bo.InputAchievement;
import com.goafanti.common.enums.AchievementCategory;
import com.goafanti.common.enums.AchievementDataCategory;
import com.goafanti.common.enums.Maturity;
import com.goafanti.common.enums.TransferModes;

public class AchievementObject extends InputAchievement {
	private String		fieldAS;
	private String		fieldBS;
	private String		fieldCS;
	private String		maturityS;			
	private String		transferModeS;
	private String categoryS;
	private String	ownerTypeS;
	private Integer isHot;
	private Date releaseDate;
	private int interestCount;
	private String dataCategoryS;
	private String firstPicture;
	private String city;

	public String getCity() {
		return city;
		
	}
	public void setCity(String city) {
		this.city = city;
	}
	public String getDataCategoryS() {
		return dataCategoryS;
	}
	public void setDataCategoryS(String dataCategoryS) {
		this.dataCategoryS = dataCategoryS;
	}
	public String getFirstPicture() {
		return firstPicture;
	}
	public void setFirstPicture(String firstPicture) {
		this.firstPicture = firstPicture;
	}
	public int getInterestCount() {
		return interestCount;
	}
	public void setInterestCount(int interestCount) {
		this.interestCount = interestCount;
	}
	public Date getReleaseDate() {
		return releaseDate;
	}
	public void setReleaseDate(Date releaseDate) {
		this.releaseDate = releaseDate;
	}
	public String getFieldAS() {
		return fieldAS;
	}
	public void setFieldAS(String fieldAS) {
		this.fieldAS = fieldAS;
	}
	public String getFieldBS() {
		return fieldBS;
	}
	public void setFieldBS(String fieldBS) {
		this.fieldBS = fieldBS;
	}
	public String getFieldCS() {
		return fieldCS;
	}
	public void setFieldCS(String fieldCS) {
		this.fieldCS = fieldCS;
	}
	public String getMaturityS() {
		return maturityS;
	}
	public void setMaturityS(String maturityS) {
		this.maturityS = maturityS;
	}
	public String getTransferModeS() {
		return transferModeS;
	}
	public void setTransferModeS(String transferModeS) {
		this.transferModeS = transferModeS;
	}
	public String getOwnerTypeS() {
		return ownerTypeS;
	}
	public void setOwnerTypeS(String ownerTypeS) {
		this.ownerTypeS = ownerTypeS;
	}
	public Integer getIsHot() {
		return isHot;
	}
	public void setIsHot(Integer isHot) {
		this.isHot = isHot;
	}
	public String getCategoryS() {
		return categoryS;
	}
	public void setCategoryS(String categoryS) {
		this.categoryS = categoryS;
	}
	
	
	//override
	@Override
	public void setCategory(Integer category) {
		// TODO Auto-generated method stub
		super.setCategory(category);
		setCategoryS(AchievementCategory.find(category.intValue()).getName());
	}
	
	@Override
	public void setTechnicalPictureUrl(String url) {
	super.setTechnicalPictureUrl(url);
	if(url!=null && url.contains(".")) {
		setFirstPicture(url.split(",")[0]);
	}
	}
	@Override
	public void setDataCategory(Integer dataCategory) {
		// TODO Auto-generated method stub
		super.setDataCategory(dataCategory);
		setDataCategoryS(AchievementDataCategory.find(dataCategory.intValue()).getName());
	//todo
	}
	@Override
	public Integer getTransferMode() {
		// TODO Auto-generated method stub
		return super.getTransferMode();
	}
	@Override
	public void setTransferMode(Integer transferMode) {
		// TODO Auto-generated method stub
		super.setTransferMode(transferMode);
//		System.out.println(transferMode.intValue()+"\n");
		setTransferModeS(TransferModes.find(transferMode.intValue()).getName());
	}
	
	@Override
	public void setMaturity(Integer maturity) {
		// TODO Auto-generated method stub
		super.setMaturity(maturity);
		setMaturityS(Maturity.find(maturity.intValue()).getName());
	}
	

	
	
}
