BusinessDisplayNode.java
package com.tradecloud.dto.base;
import org.apache.commons.lang.StringUtils;
/**
* This is a class for representing a node on a tree or breadcrumb. It should
* contain enough info for display purposes, and to allow finding the original
* object
*
* @author jon
*/
public class BusinessDisplayNode {
public final static int ABBR_LENGTH = 20;
private Long id;
private Class c;
private String shortDesc;
private String mediumDesc;
private Enum state;
private Enum type;
private BusinessDisplayNode children[];
public BusinessDisplayNode(Long id, Class c, String shortDesc, Enum state) {
this.id = id;
this.c = c;
this.shortDesc = shortDesc;
this.state = state;
}
public BusinessDisplayNode(Long id, Class c, String shortDesc, Enum state, Enum type) {
this(id, c, shortDesc, state);
this.type = type;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public Class getC() {
return c;
}
public void setC(Class c) {
this.c = c;
}
public String getShortDesc() {
return shortDesc;
}
public void setShortDesc(String shortDesc) {
this.shortDesc = shortDesc;
}
public String getMediumDesc() {
return mediumDesc;
}
public void setMediumDesc(String mediumDesc) {
this.mediumDesc = mediumDesc;
}
public void setState(Enum state) {
this.state = state;
}
public Enum getState() {
return state;
}
public BusinessDisplayNode[] getChildren() {
return children;
}
public void setChildren(BusinessDisplayNode[] children) {
this.children = children;
}
public Enum getType() {
return type;
}
public void setType(Enum type) {
this.type = type;
}
public String getShortDescAbbr() {
return StringUtils.abbreviate(shortDesc, ABBR_LENGTH);
}
// Only for bean properties
public void setShortDescAbbr(String shortDesc) {
setShortDesc(shortDesc);
}
}