KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > entities > content > ContentCategoryVO


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Content Management Platform (www.infoglue.org)
4  *
5  * ===============================================================================
6  *
7  * Copyright (C)
8  *
9  * This program is free software; you can redistribute it and/or modify it under
10  * the terms of the GNU General Public License version 2, as published by the
11  * Free Software Foundation. See the file LICENSE.html for more information.
12  *
13  * This program is distributed in the hope that it will be useful, but WITHOUT
14  * ANY WARRANTY, including the implied warranty of MERCHANTABILITY or FITNESS
15  * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc. / 59 Temple
19  * Place, Suite 330 / Boston, MA 02111-1307 / USA.
20  *
21  * ===============================================================================
22  * $Id: ContentCategoryVO.java,v 1.2 2004/12/13 13:49:50 jed Exp $
23  */

24 package org.infoglue.cms.entities.content;
25
26 import org.infoglue.cms.entities.kernel.Persistent;
27 import org.infoglue.cms.entities.management.CategoryVO;
28 import org.infoglue.cms.util.ConstraintExceptionBuffer;
29 import org.infoglue.cms.util.DomainUtils;
30
31 /**
32  *
33  * @author Frank Febbraro (frank@phase2technology.com)
34  */

35 public class ContentCategoryVO extends Persistent
36 {
37     private Integer JavaDoc contentCategoryId;
38     private String JavaDoc attributeName;
39     private Integer JavaDoc contentVersionId;
40     private CategoryVO category = new CategoryVO();
41
42     public ContentCategoryVO() {}
43
44     public ContentCategoryVO(String JavaDoc attributeName, Integer JavaDoc contentVersionId, CategoryVO category)
45     {
46         setAttributeName(attributeName);
47         setContentVersionId(contentVersionId);
48         setCategory(category);
49     }
50
51     public ContentCategoryVO(Integer JavaDoc id, String JavaDoc attributeName, Integer JavaDoc contentVersionId, CategoryVO category)
52     {
53         this(attributeName, contentVersionId, category);
54         setContentCategoryId(id);
55     }
56
57     public Integer JavaDoc getId()
58     {
59         return getContentCategoryId();
60     }
61
62     public Integer JavaDoc getContentCategoryId()
63     {
64         return contentCategoryId;
65     }
66
67     public void setContentCategoryId(Integer JavaDoc i)
68     {
69         contentCategoryId = i;
70     }
71
72     public String JavaDoc getAttributeName()
73     {
74         return attributeName;
75     }
76
77     public void setAttributeName(String JavaDoc s)
78     {
79         attributeName = s;
80     }
81
82     public Integer JavaDoc getContentVersionId()
83     {
84         return contentVersionId;
85     }
86
87     public void setContentVersionId(Integer JavaDoc i)
88     {
89         contentVersionId = i;
90     }
91
92     public CategoryVO getCategory()
93     {
94         return category;
95     }
96
97     public void setCategory(CategoryVO c)
98     {
99         category = (c != null) ? c : new CategoryVO();
100     }
101
102     /**
103      * Not used
104      */

105     public ConstraintExceptionBuffer validate()
106     {
107         return new ConstraintExceptionBuffer();
108     }
109
110     public boolean equals(Object JavaDoc o)
111     {
112         if (super.equals(o))
113         {
114             ContentCategoryVO vo = (ContentCategoryVO)o;
115             return DomainUtils.equals(contentCategoryId, vo.contentCategoryId)
116                     && DomainUtils.equals(attributeName, vo.attributeName)
117                     && DomainUtils.equals(contentVersionId, vo.contentVersionId)
118                     && DomainUtils.equals(category.getId(), vo.category.getId());
119         }
120         return false;
121     }
122
123     public StringBuffer JavaDoc toStringBuffer()
124     {
125         StringBuffer JavaDoc sb = super.toStringBuffer();
126         sb.append(" attributeName=").append(attributeName)
127                 .append(" contentVersionId=").append(contentVersionId)
128                 .append(" categoryId=").append(category.getId());
129         return sb;
130     }
131
132 }
133
134
Popular Tags