Subversion Repositories SmartDukaan

Rev

Rev 62 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 62 Rev 81
Line 23... Line 23...
23
	 * Category ID
23
	 * Category ID
24
	 */
24
	 */
25
	private long categoryID;
25
	private long categoryID;
26
	
26
	
27
	/**
27
	/**
28
	 * List of valid facets for category ID
28
	 * List of facet rules for the category ID
29
	 */
29
	 */
30
	private List<Long> facetDefinitionIDs;
30
	private List<FacetRuleDefinition> facetRuleDefinitions;
31
 
31
 
32
	/**
32
	/**
33
	 * 
33
	 * 
34
	 */
34
	 */
35
	public CategoryFacetDefinition(long categoryID) {
35
	public CategoryFacetDefinition(long categoryID) {
Line 42... Line 42...
42
	public long getCategoryID() {
42
	public long getCategoryID() {
43
		return this.categoryID;
43
		return this.categoryID;
44
	}
44
	}
45
	
45
	
46
	/**
46
	/**
47
	 * Convenient method to add new facet ID
47
	 * @param facetRuleDefinitions the facetRuleDefinitions to set
48
	 *  
-
 
49
	 * @param facetID
-
 
50
	 */
48
	 */
51
	public void addFacetDefinitionID(long facetID) {
49
	public void setFacetRuleDefinitions(List<FacetRuleDefinition> facetRuleDefinitions) {
52
		if(this.facetDefinitionIDs == null) {
-
 
53
			this.facetDefinitionIDs = new ArrayList<Long>();
50
		this.facetRuleDefinitions = facetRuleDefinitions;
54
		}
-
 
55
		
-
 
56
		this.facetDefinitionIDs.add(new Long(facetID));
-
 
57
	} 
51
	}
58
 
52
 
59
	/**
53
	/**
60
	 * @param facetIDs the facetIDs to set
54
	 * @return the facetRuleDefinitions
61
	 */
55
	 */
62
	public void setFacetDefinitionIDs(List<Long> facetDefinitionIDs) {
56
	public List<FacetRuleDefinition> getFacetRuleDefinitions() {
63
		this.facetDefinitionIDs = facetDefinitionIDs;
57
		return facetRuleDefinitions;
64
	}
58
	}
65
	
59
	
66
	/**
60
	/**
-
 
61
	 * Utility method to add new FacetRuleDefinition objects
67
	 * 
62
	 * 
68
	 * @param facetIDs
63
	 * @param facetRuleDef
69
	 */
64
	 */
70
	public void appendFacetDefinitionIDs(List<Long> facetIDs) {
65
	public void addFacetRuleDefinition(FacetRuleDefinition facetRuleDef) {
71
		if(this.facetDefinitionIDs == null) {
66
		if(this.facetRuleDefinitions == null) {
72
			this.facetDefinitionIDs = new ArrayList<Long>();
67
			this.facetRuleDefinitions = new ArrayList<FacetRuleDefinition>();
73
		}
68
		}
74
		
69
		
75
		this.facetDefinitionIDs.addAll(facetIDs);
70
		this.facetRuleDefinitions.add(facetRuleDef);
76
	}
71
	}
77
	
72
	
78
	/**
73
	/**
-
 
74
	 * Utility method to append list of FacetRuleDefinition objects
-
 
75
	 * 
79
	 * @return the facetIDs
76
	 * @param facetRuleDefs
80
	 */
77
	 */
81
	public List<Long> getFacetDefinitionIDs() {
78
	public void appendFacetRuleDefinitions(
-
 
79
			List<FacetRuleDefinition> facetRuleDefs) {
82
		return facetDefinitionIDs;
80
		if(this.facetRuleDefinitions == null) {
-
 
81
			this.facetRuleDefinitions = new ArrayList<FacetRuleDefinition>();
-
 
82
		}
-
 
83
		
-
 
84
		this.facetRuleDefinitions.addAll(facetRuleDefs);
83
	}
85
	}
84
 
86
 
85
	/* (non-Javadoc)
87
	/* (non-Javadoc)
86
	 * @see java.lang.Object#toString()
88
	 * @see java.lang.Object#toString()
87
	 */
89
	 */
88
	@Override
90
	@Override
89
	public String toString() {
91
	public String toString() {
90
		return "CategoryFacetDefinition [categoryID=" + categoryID
92
		return "CategoryFacetDefinition [categoryID=" + categoryID
91
				+ ", facetDefinitionIDs=" + facetDefinitionIDs + "]";
93
				+ ", facetRuleDefinitions=" + facetRuleDefinitions + "]";
92
	}
94
	}
93
 
95
 
94
}
96
}