001
014
015 package com.liferay.portal.model;
016
017 import com.liferay.portal.kernel.util.Validator;
018
019 import java.util.HashMap;
020 import java.util.Map;
021
022
031 public class PortalPreferencesWrapper implements PortalPreferences,
032 ModelWrapper<PortalPreferences> {
033 public PortalPreferencesWrapper(PortalPreferences portalPreferences) {
034 _portalPreferences = portalPreferences;
035 }
036
037 public Class<?> getModelClass() {
038 return PortalPreferences.class;
039 }
040
041 public String getModelClassName() {
042 return PortalPreferences.class.getName();
043 }
044
045 public Map<String, Object> getModelAttributes() {
046 Map<String, Object> attributes = new HashMap<String, Object>();
047
048 attributes.put("portalPreferencesId", getPortalPreferencesId());
049 attributes.put("ownerId", getOwnerId());
050 attributes.put("ownerType", getOwnerType());
051 attributes.put("preferences", getPreferences());
052
053 return attributes;
054 }
055
056 public void setModelAttributes(Map<String, Object> attributes) {
057 Long portalPreferencesId = (Long)attributes.get("portalPreferencesId");
058
059 if (portalPreferencesId != null) {
060 setPortalPreferencesId(portalPreferencesId);
061 }
062
063 Long ownerId = (Long)attributes.get("ownerId");
064
065 if (ownerId != null) {
066 setOwnerId(ownerId);
067 }
068
069 Integer ownerType = (Integer)attributes.get("ownerType");
070
071 if (ownerType != null) {
072 setOwnerType(ownerType);
073 }
074
075 String preferences = (String)attributes.get("preferences");
076
077 if (preferences != null) {
078 setPreferences(preferences);
079 }
080 }
081
082
087 public long getPrimaryKey() {
088 return _portalPreferences.getPrimaryKey();
089 }
090
091
096 public void setPrimaryKey(long primaryKey) {
097 _portalPreferences.setPrimaryKey(primaryKey);
098 }
099
100
105 public long getPortalPreferencesId() {
106 return _portalPreferences.getPortalPreferencesId();
107 }
108
109
114 public void setPortalPreferencesId(long portalPreferencesId) {
115 _portalPreferences.setPortalPreferencesId(portalPreferencesId);
116 }
117
118
123 public long getOwnerId() {
124 return _portalPreferences.getOwnerId();
125 }
126
127
132 public void setOwnerId(long ownerId) {
133 _portalPreferences.setOwnerId(ownerId);
134 }
135
136
141 public int getOwnerType() {
142 return _portalPreferences.getOwnerType();
143 }
144
145
150 public void setOwnerType(int ownerType) {
151 _portalPreferences.setOwnerType(ownerType);
152 }
153
154
159 public java.lang.String getPreferences() {
160 return _portalPreferences.getPreferences();
161 }
162
163
168 public void setPreferences(java.lang.String preferences) {
169 _portalPreferences.setPreferences(preferences);
170 }
171
172 public boolean isNew() {
173 return _portalPreferences.isNew();
174 }
175
176 public void setNew(boolean n) {
177 _portalPreferences.setNew(n);
178 }
179
180 public boolean isCachedModel() {
181 return _portalPreferences.isCachedModel();
182 }
183
184 public void setCachedModel(boolean cachedModel) {
185 _portalPreferences.setCachedModel(cachedModel);
186 }
187
188 public boolean isEscapedModel() {
189 return _portalPreferences.isEscapedModel();
190 }
191
192 public java.io.Serializable getPrimaryKeyObj() {
193 return _portalPreferences.getPrimaryKeyObj();
194 }
195
196 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
197 _portalPreferences.setPrimaryKeyObj(primaryKeyObj);
198 }
199
200 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
201 return _portalPreferences.getExpandoBridge();
202 }
203
204 public void setExpandoBridgeAttributes(
205 com.liferay.portal.service.ServiceContext serviceContext) {
206 _portalPreferences.setExpandoBridgeAttributes(serviceContext);
207 }
208
209 @Override
210 public java.lang.Object clone() {
211 return new PortalPreferencesWrapper((PortalPreferences)_portalPreferences.clone());
212 }
213
214 public int compareTo(
215 com.liferay.portal.model.PortalPreferences portalPreferences) {
216 return _portalPreferences.compareTo(portalPreferences);
217 }
218
219 @Override
220 public int hashCode() {
221 return _portalPreferences.hashCode();
222 }
223
224 public com.liferay.portal.model.CacheModel<com.liferay.portal.model.PortalPreferences> toCacheModel() {
225 return _portalPreferences.toCacheModel();
226 }
227
228 public com.liferay.portal.model.PortalPreferences toEscapedModel() {
229 return new PortalPreferencesWrapper(_portalPreferences.toEscapedModel());
230 }
231
232 public com.liferay.portal.model.PortalPreferences toUnescapedModel() {
233 return new PortalPreferencesWrapper(_portalPreferences.toUnescapedModel());
234 }
235
236 @Override
237 public java.lang.String toString() {
238 return _portalPreferences.toString();
239 }
240
241 public java.lang.String toXmlString() {
242 return _portalPreferences.toXmlString();
243 }
244
245 public void persist()
246 throws com.liferay.portal.kernel.exception.SystemException {
247 _portalPreferences.persist();
248 }
249
250 @Override
251 public boolean equals(Object obj) {
252 if (this == obj) {
253 return true;
254 }
255
256 if (!(obj instanceof PortalPreferencesWrapper)) {
257 return false;
258 }
259
260 PortalPreferencesWrapper portalPreferencesWrapper = (PortalPreferencesWrapper)obj;
261
262 if (Validator.equals(_portalPreferences,
263 portalPreferencesWrapper._portalPreferences)) {
264 return true;
265 }
266
267 return false;
268 }
269
270
273 public PortalPreferences getWrappedPortalPreferences() {
274 return _portalPreferences;
275 }
276
277 public PortalPreferences getWrappedModel() {
278 return _portalPreferences;
279 }
280
281 public void resetOriginalValues() {
282 _portalPreferences.resetOriginalValues();
283 }
284
285 private PortalPreferences _portalPreferences;
286 }