Subversion Repositories SmartDukaan

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
10 shop2020 1
/**
2
 * 
3
 */
4
package in.shop2020.metamodel.definitions;
5
 
6
import java.util.ArrayList;
7
import java.util.List;
8
 
9
import in.shop2020.metamodel.util.ReusableMetaModelComponent;
10
 
11
/**
12
 * 
13
 * @author naveen
14
 *
15
 */
16
public class Category extends ReusableMetaModelComponent {
17
	/**
18
	 * 
19
	 */
20
	private static final long serialVersionUID = 1L;
21
	private String label;
22
	private String description;
23
	private List<CategorySlideDefinition> categorySlideDefintions;
24
	private Category parentCategory;
25
	private List<Category> childrenCategory;
26
 
27
	/**
28
	 * 
29
	 * @param newID
30
	 */
31
	public Category(long newID) {
32
		super(newID);
33
	}
34
 
35
	/**
36
	 * 
37
	 * @return label
38
	 */
39
	public String getLabel() {
40
		return this.label;
41
	}
42
 
43
	/**
44
	 * 
45
	 * @param value
46
	 */
47
	public void setLabel(String value) {
48
		this.label = value;
49
	}
50
 
51
	/**
52
	 * 
53
	 * @return description
54
	 */
55
	public String getDescription() {
56
		return this.description;
57
	}
58
 
59
	/**
60
	 * 
61
	 * @param value
62
	 */
63
	public void setDescription(String value) {
64
		this.description = value;
65
	}
66
 
67
	/**
68
	 * @return the categorySlideDefintions
69
	 */
70
	public List<CategorySlideDefinition> getCategorySlideDefintions() {
71
		return categorySlideDefintions;
72
	}
73
 
74
	/**
75
	 * @param categorySlideDefintions the categorySlideDefintions to set
76
	 */
77
	public void setCategorySlideDefintions(
78
			List<CategorySlideDefinition> categorySlideDefintions) {
79
		this.categorySlideDefintions = categorySlideDefintions;
80
	}
81
 
82
	/**
83
	 * 
84
	 * @param categoryDefinition
85
	 */
86
	public void addCategorySlideDefintion(CategorySlideDefinition categoryDefinition) {
87
		if(this.categorySlideDefintions == null) {
88
			this.categorySlideDefintions = new ArrayList<CategorySlideDefinition>();
89
		}
90
		this.categorySlideDefintions.add(categoryDefinition);
91
	}
92
 
93
	/**
94
	 * @param parentCategory the parentCategory to set
95
	 */
96
	public void setParentCategory(Category parentCategory) {
97
		this.parentCategory = parentCategory;
98
	}
99
 
100
	/**
101
	 * @return the parentCategory
102
	 */
103
	public Category getParentCategory() {
104
		return parentCategory;
105
	}
106
 
107
	/**
108
	 * @param childrenCategory the childrenCategory to set
109
	 */
110
	public void setChildrenCategory(List<Category> childrenCategory) {
111
		this.childrenCategory = childrenCategory;
112
	}
113
 
114
	/**
115
	 * @param childrenCategory the childrenCategory to set
116
	 */
117
	public void addChild(Category child) {
118
		if(this.childrenCategory == null) {
119
			this.childrenCategory = new ArrayList<Category>();
120
		}
121
		this.childrenCategory.add(child);
122
	}
123
 
124
	/**
125
	 * @return the childrenCategory
126
	 */
127
	public List<Category> getChildrenCategory() {
128
		return childrenCategory;
129
	}
130
 
131
	/* (non-Javadoc)
132
	 * @see java.lang.Object#toString()
133
	 */
134
	@Override
135
	public String toString() {
136
		/*
137
		return "Category [categorySlideDefintions=" + categorySlideDefintions
138
				+ ", childrenCategory=" + childrenCategory + ", description="
139
				+ description + ", label=" + label + ", parentCategory="
140
				+ parentCategory + "]";
141
		*/
142
		return "Category [categorySlideDefintions=" + categorySlideDefintions
143
		+ ", id=" + id + ", description=" + description + ", label=" + label + "]";
144
	}
145
 
146
}