package com.gh.gamecenter.entity;

public class AdEntity {

	public static AdEntity str2AdEntity(String data) {
		String[] ad = data.split(",");
		AdEntity adEntity = new AdEntity();
		adEntity.setPicUrl(ad[0]);
		if (ad[1] == null || "null".equals(ad[1])) {
			adEntity.setPicPath(null);
		} else {
			adEntity.setPicPath(ad[1]);
		}
		adEntity.setGameId(ad[2]);
		adEntity.setBgColor(ad[3]);
		adEntity.setLastShowTime(Long.valueOf(ad[4]));
		return adEntity;
	}

	private String picUrl;

	private String picPath;

	private String gameId;

	private String bgColor;

	private long lastShowTime;

	public String getPicUrl() {
		return picUrl;
	}

	public void setPicUrl(String picUrl) {
		this.picUrl = picUrl;
	}

	public String getPicPath() {
		return picPath;
	}

	public void setPicPath(String picPath) {
		this.picPath = picPath;
	}

	public String getGameId() {
		return gameId;
	}

	public void setGameId(String gameId) {
		this.gameId = gameId;
	}

	public String getBgColor() {
		return bgColor;
	}

	public void setBgColor(String bgColor) {
		this.bgColor = bgColor;
	}

	public long getLastShowTime() {
		return lastShowTime;
	}

	public void setLastShowTime(long lastShowTime) {
		this.lastShowTime = lastShowTime;
	}

	@Override
	public String toString() {
		return picUrl + "," + picPath + "," + gameId + "," + bgColor + ","
				+ lastShowTime;
	}

}
