package cn.net.connor.std.processedit.meopviewfx.bean;

import java.util.ArrayList;
import java.util.List;

import cn.net.connor.std.aifrcp.util.KUtil;

public class TextBean {

	private String text;
	private String realValue;
	public List<TextBean> children = new ArrayList<TextBean>();
	
	public TextBean(String text) {
		this.text = text;
	}
	
	public void setRealValue(String realValue) {
		this.realValue = realValue;
	}
	
	public String getRealValue() {
		return KUtil.isEmpty(realValue)?text:realValue;
	}
	
	public String getDisplayValue() {
		return text;
	}

	@Override
	public String toString() {
		return getDisplayValue();
	}
	
	@Override
	public boolean equals(Object obj) {
		if(obj==null) {
			return false;
		}
		if(obj instanceof TextBean) {
			return text.equals(((TextBean) obj).text);
		}
		return false;
	}
	
}
