Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
56 naveen 1
/**
2
 * 
3
 */
4
package in.shop2020.metamodel.definitions;
5
 
61 naveen 6
import java.util.ArrayList;
7
import java.util.List;
8
 
56 naveen 9
import in.shop2020.metamodel.util.MetaModelComponent;
10
 
11
/**
12
 * @author naveen
13
 *
14
 */
15
public class CategoryFacetDefinition extends MetaModelComponent {
16
 
17
	/**
18
	 * 
19
	 */
20
	private static final long serialVersionUID = 1L;
61 naveen 21
 
22
	/**
23
	 * Category ID
24
	 */
25
	private long categoryID;
26
 
27
	/**
28
	 * List of valid facets for category ID
29
	 */
30
	private List<Long> facetIDs;
56 naveen 31
 
32
	/**
33
	 * 
34
	 */
61 naveen 35
	public CategoryFacetDefinition(long categoryID) {
36
		this.categoryID = categoryID;
56 naveen 37
	}
38
 
61 naveen 39
	/**
40
	 * @return the categorID
41
	 */
42
	public long getCategoryID() {
43
		return this.categoryID;
44
	}
45
 
46
	/**
47
	 * Convenient method to add new facet ID
48
	 *  
49
	 * @param facetID
50
	 */
51
	public void addFacetID(long facetID) {
52
		if(this.facetIDs == null) {
53
			this.facetIDs = new ArrayList<Long>();
54
		}
55
		this.facetIDs.add(new Long(facetID));
56
	} 
57
 
58
	/**
59
	 * @param facetIDs the facetIDs to set
60
	 */
61
	public void setFacetIDs(List<Long> facetIDs) {
62
		this.facetIDs = facetIDs;
63
	}
64
 
65
	/**
66
	 * 
67
	 * @param facetIDs
68
	 */
69
	public void appendFacetIDs(List<Long> facetIDs) {
70
		if(this.facetIDs == null) {
71
			this.facetIDs = new ArrayList<Long>();
72
		}
73
 
74
		this.facetIDs.addAll(facetIDs);
75
	}
76
 
77
	/**
78
	 * @return the facetIDs
79
	 */
80
	public List<Long> getFacetIDs() {
81
		return facetIDs;
82
	}
83
 
84
	/* (non-Javadoc)
85
	 * @see java.lang.Object#toString()
86
	 */
87
	@Override
88
	public String toString() {
89
		return "CategoryFacetDefinition [categoryID=" + categoryID
90
				+ ", facetIDs=" + facetIDs + "]";
91
	}
92
 
56 naveen 93
}