Subversion Repositories SmartDukaan

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
7263 anupam.sin 1
package in.shop2020.serving.utils;
2
 
3
import java.io.Serializable;
4
import java.util.ArrayList;
5
import java.util.List;
6
 
7
public class Category implements Serializable {
8
 
9
	private static final long serialVersionUID = 1L;
10
 
11
	private long id;
12
 
13
	private String label;
14
 
15
	private String description;
16
 
17
	private long parentCategoryId;
18
 
19
	private List<Long> childrenCategoryIds;
20
 
21
 
22
	public Category(long newID) {
23
		this.setId(newID); 
24
	}
25
 
26
	public void setId(long id) {
27
		this.id = id;
28
	}
29
 
30
	public long getId() {
31
		return id;
32
	}
33
 
34
	/**
35
	 * 
36
	 * @return label
37
	 */
38
	public String getLabel() {
39
		return this.label;
40
	}
41
 
42
	/**
43
	 * 
44
	 * @param label to set
45
	 */
46
	public void setLabel(String value) {
47
		this.label = value;
48
	}
49
 
50
	/**
51
	 * 
52
	 * @return description 
53
	 */
54
	public String getDescription() {
55
		return this.description;
56
	}
57
 
58
	/**
59
	 * 
60
	 * @param description to set
61
	 */
62
	public void setDescription(String value) {
63
		this.description = value;
64
	}
65
 
66
	/**
67
	 * @param parentCategory the parentCategory to set
68
	 */
69
	public void setParentCategoryId(long parentCategoryId) {
70
		this.parentCategoryId = parentCategoryId;
71
	}
72
 
73
	/**
74
	 * @return the parentCategory
75
	 */
76
	public long getParentCategoryId() {
77
		return parentCategoryId;
78
	}
79
 
80
	/**
81
	 * @param childrenCategory the childrenCategory to set
82
	 */
83
	public void setChildrenCategory(List<Long> childrenCategoryIds) {
84
		this.childrenCategoryIds = childrenCategoryIds;
85
	}
86
 
87
	/**
88
	 * Convenient method to add new children categories 
89
	 * 
90
	 * @param childrenCategory the childrenCategory to set
91
	 */
92
	public void addChild(long child) {
93
		if(this.childrenCategoryIds == null) {
94
			this.childrenCategoryIds = new ArrayList<Long>();
95
		}
96
		this.childrenCategoryIds.add(child);
97
	}
98
 
99
	/**
100
	 * @return the childrenCategory
101
	 */
102
	public List<Long> getChildrenCategoryIds() {
103
		return childrenCategoryIds;
104
	}
105
 
106
}