001
014
015 package com.liferay.portal.util;
016
017 import com.liferay.portal.kernel.util.HtmlUtil;
018 import com.liferay.portal.kernel.util.StringBundler;
019
020 import java.io.Serializable;
021
022
025 public class LayoutDescription implements Serializable {
026
027 public LayoutDescription(long plid, String name, int depth) {
028 _plid = plid;
029 _name = name;
030 _depth = depth;
031 }
032
033 public int getDepth() {
034 return _depth;
035 }
036
037 public String getDisplayName() {
038 StringBundler sb = new StringBundler(_depth + 1);
039
040 for (int i = 0; i < _depth; i++) {
041 sb.append("- ");
042 }
043
044 sb.append(HtmlUtil.escape(_name));
045
046 return sb.toString();
047 }
048
049 public String getName() {
050 return _name;
051 }
052
053 public long getPlid() {
054 return _plid;
055 }
056
057 @Override
058 public String toString() {
059 StringBundler sb = new StringBundler(7);
060
061 sb.append("{depth=");
062 sb.append(_depth);
063 sb.append(", name=");
064 sb.append(_name);
065 sb.append(", plid=");
066 sb.append(_plid);
067 sb.append("}");
068
069 return sb.toString();
070 }
071
072 private final int _depth;
073 private final String _name;
074 private final long _plid;
075
076 }