package com.blueland.bpm.engine.core.model;

import com.fasterxml.jackson.annotation.JsonIgnore;

/**
 * 下一环节资源对象
 * 
 * @version: 1.0
 * @author lw
 */
public class ActivityResourceModel implements java.io.Serializable{
	private static final long serialVersionUID = 1L;
	/**
	 * 唯一标识
	 */
	private String id;  
	/**
	 * 父唯一标识
	 */
    private String parentId;  
    /**
	 * 名称
	 */
    private String name;  
    /**
	 * 类型,ORG:组织,USER:人员
	 */
    private String type;
    /**
	 * 级别
	 */
    private Integer level;
    /**
	 * 排序字段
	 */
    private Integer sort;
    /**
     * 备注
     */
    private String remark;
   // @JsonIgnore
    private String realId;
   
	public ActivityResourceModel(String realId,String id, String pId, String name, Integer level, String type,Integer sort) {
		super();
		this.id = id;
		this.parentId = pId;
		this.name = name;
		this.type = type;
		this.level = level;
		this.sort = sort;
		this.realId=realId;
		
	}
	
	public ActivityResourceModel(String id, String pId, String name, Integer level, String type,Integer sort) {
		super();
		this.id = id;
		this.parentId = pId;
		this.name = name;
		this.type = type;
		this.level = level;
		this.sort = sort;
	}
	
	
	public String getId() {
		return id;
	}

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



	public String getParentId() {
		return parentId;
	}



	public void setParentId(String parentId) {
		this.parentId = parentId;
	}



	public String getName() {
		return name;
	}

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

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public Integer getLevel() {
		return level;
	}

	public void setLevel(Integer level) {
		this.level = level;
	}

	
	public Integer getSort() {
		return sort;
	}

	public void setSort(Integer sort) {
		this.sort = sort;
	}



	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((id == null) ? 0 : id.hashCode());
		result = prime * result
				+ ((parentId == null) ? 0 : parentId.hashCode());
		return result;
	}



	public String getRealId() {
		return realId!=null?realId:id;
	}

	public void setRealId(String realId) {
		this.realId = realId;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ActivityResourceModel other = (ActivityResourceModel) obj;
		if (id == null) {
			if (other.id != null)
				return false;
		} else if (!id.equals(other.id))
			return false;
		if (parentId == null) {
			if (other.parentId != null)
				return false;
		} else if (!parentId.equals(other.parentId))
			return false;
		return true;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}
	
}
