package com.bocloud.ims.entity.resource;

import com.bocloud.entity.annotations.Column;
import com.bocloud.entity.annotations.PK;
import com.bocloud.entity.annotations.Table;
import com.bocloud.entity.bean.Generic;
import com.bocloud.entity.meta.PKStrategy;

/**
 * 命名规则
 *
 * @author wangyu
 * @version 3.0.0-SNAPSHOT
 * @since 2018/7/2
 */
@Table("name_rule")
public class NameRule extends Generic {

	@PK(PKStrategy.AUTO)
	private Long id;// ID
	@Column("name")
	private String name;// 名称
	@Column("has_tenant")
	private Boolean hasTenant;// 包含租户
	@Column("has_user")
	private Boolean hasUser;// 包含用户
	@Column("has_business")
	private Boolean hasBusiness;// 包含业务
	@Column("has_project")
	private Boolean hasProject;// 包含项目
	@Column("customize")
	private String customize;// 自定义
	@Column("tenant_id")
	private Long tenantId;// 租户id
	@Column("suffix_type")
	private String suffixType;// 后缀类型(RandomString(随机字符串)/Millis(毫秒数)/Number(顺序编号))
	@Column("suffix_length")
	private Long suffixLength;// 后缀长度
	@Column("current_num")
	private Long currentNum;// 当前值(后缀为Number时)

	/**
	 *
	 */
	public NameRule() {
	}

	/**
	 * @param name
	 * @param hasTenant
	 * @param hasUser
	 * @param hasBusiness
	 * @param hasProject
	 * @param customize
	 * @param tenantId
	 * @param suffixType
	 * @param suffixLength
	 * @param currentNum
	 */
	public NameRule(String name, Boolean hasTenant, Boolean hasUser, Boolean hasBusiness, Boolean hasProject,
			String customize, Long tenantId, String suffixType, Long suffixLength, Long currentNum) {
		this.name = name;
		this.hasTenant = hasTenant;
		this.hasUser = hasUser;
		this.hasBusiness = hasBusiness;
		this.hasProject = hasProject;
		this.customize = customize;
		this.tenantId = tenantId;
		this.suffixType = suffixType;
		this.suffixLength = suffixLength;
		this.currentNum = currentNum;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Boolean getHasTenant() {
		return hasTenant;
	}

	public void setHasTenant(Boolean hasTenant) {
		this.hasTenant = hasTenant;
	}

	public Boolean getHasUser() {
		return hasUser;
	}

	public void setHasUser(Boolean hasUser) {
		this.hasUser = hasUser;
	}

	public Boolean getHasBusiness() {
		return hasBusiness;
	}

	public void setHasBusiness(Boolean hasBusiness) {
		this.hasBusiness = hasBusiness;
	}

	public Boolean getHasProject() {
		return hasProject;
	}

	public void setHasProject(Boolean hasProject) {
		this.hasProject = hasProject;
	}

	public String getCustomize() {
		return customize;
	}

	public void setCustomize(String customize) {
		this.customize = customize;
	}

	public Long getTenantId() {
		return tenantId;
	}

	public void setTenantId(Long tenantId) {
		this.tenantId = tenantId;
	}

	public String getSuffixType() {
		return suffixType;
	}

	public void setSuffixType(String suffixType) {
		this.suffixType = suffixType;
	}

	public Long getSuffixLength() {
		return suffixLength;
	}

	public void setSuffixLength(Long suffixLength) {
		this.suffixLength = suffixLength;
	}

	public Long getCurrentNum() {
		return currentNum;
	}

	public void setCurrentNum(Long currentNum) {
		this.currentNum = currentNum;
	}

	public enum SuffixType {
		RandomString, // 随机字符串
		Millis, // 毫秒数
		Number// 顺序编号
	}
}
