KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > infoglue > cms > entities > management > PropertiesCategoryVO


1 /* ===============================================================================
2  *
3  * Part of the InfoGlue Properties 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: PropertiesCategoryVO.java,v 1.2 2006/03/06 17:19:50 mattias Exp $
23  */

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

34 public class PropertiesCategoryVO extends Persistent
35 {
36     private Integer JavaDoc propertiesCategoryId;
37     private String JavaDoc attributeName;
38     private String JavaDoc entityName;
39     private Integer JavaDoc entityId;
40     private CategoryVO category = new CategoryVO();
41
42     public PropertiesCategoryVO() {}
43
44     public PropertiesCategoryVO(String JavaDoc attributeName, String JavaDoc entityName, Integer JavaDoc entityId, CategoryVO category)
45     {
46         setAttributeName(attributeName);
47         setEntityName(entityName);
48         setEntityId(entityId);
49         setCategory(category);
50     }
51
52     public PropertiesCategoryVO(Integer JavaDoc id, String JavaDoc attributeName, String JavaDoc entityName, Integer JavaDoc entityId, CategoryVO category)
53     {
54         this(attributeName, entityName, entityId, category);
55         setPropertiesCategoryId(id);
56     }
57
58     public Integer JavaDoc getId()
59     {
60         return getPropertiesCategoryId();
61     }
62
63     public Integer JavaDoc getPropertiesCategoryId()
64     {
65         return propertiesCategoryId;
66     }
67
68     public void setPropertiesCategoryId(Integer JavaDoc i)
69     {
70         propertiesCategoryId = i;
71     }
72
73     public String JavaDoc getAttributeName()
74     {
75         return attributeName;
76     }
77
78     public void setAttributeName(String JavaDoc s)
79     {
80         attributeName = s;
81     }
82
83     public Integer JavaDoc getEntityId()
84     {
85         return entityId;
86     }
87     
88     public void setEntityId(Integer JavaDoc entityId)
89     {
90         this.entityId = entityId;
91     }
92     
93     public String JavaDoc getEntityName()
94     {
95         return entityName;
96     }
97     
98     public void setEntityName(String JavaDoc entityName)
99     {
100         this.entityName = entityName;
101     }
102
103     public CategoryVO getCategory()
104     {
105         return category;
106     }
107
108     public void setCategory(CategoryVO c)
109     {
110         category = (c != null) ? c : new CategoryVO();
111     }
112
113     /**
114      * Not used
115      */

116     public ConstraintExceptionBuffer validate()
117     {
118         return new ConstraintExceptionBuffer();
119     }
120
121     public boolean equals(Object JavaDoc o)
122     {
123         if (super.equals(o))
124         {
125             PropertiesCategoryVO vo = (PropertiesCategoryVO)o;
126             return DomainUtils.equals(propertiesCategoryId, vo.propertiesCategoryId)
127                     && DomainUtils.equals(attributeName, vo.attributeName)
128                     && DomainUtils.equals(entityName, vo.entityName)
129                     && DomainUtils.equals(entityId, vo.entityId)
130                     && DomainUtils.equals(category.getId(), vo.category.getId());
131         }
132         return false;
133     }
134
135     public StringBuffer JavaDoc toStringBuffer()
136     {
137         StringBuffer JavaDoc sb = super.toStringBuffer();
138         sb.append(" attributeName=").append(attributeName)
139                 .append(" entityName=").append(entityName)
140                 .append(" entityId=").append(entityId)
141                 .append(" categoryId=").append(category.getId());
142         return sb;
143     }
144
145 }
146
147
Popular Tags