001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.dynamicdatamapping.model;
016    
017    import com.liferay.portal.kernel.util.Validator;
018    import com.liferay.portal.model.ModelWrapper;
019    
020    import java.util.Date;
021    import java.util.HashMap;
022    import java.util.Map;
023    
024    /**
025     * <p>
026     * This class is a wrapper for {@link DDMContent}.
027     * </p>
028     *
029     * @author    Brian Wing Shun Chan
030     * @see       DDMContent
031     * @generated
032     */
033    public class DDMContentWrapper implements DDMContent, ModelWrapper<DDMContent> {
034            public DDMContentWrapper(DDMContent ddmContent) {
035                    _ddmContent = ddmContent;
036            }
037    
038            public Class<?> getModelClass() {
039                    return DDMContent.class;
040            }
041    
042            public String getModelClassName() {
043                    return DDMContent.class.getName();
044            }
045    
046            public Map<String, Object> getModelAttributes() {
047                    Map<String, Object> attributes = new HashMap<String, Object>();
048    
049                    attributes.put("uuid", getUuid());
050                    attributes.put("contentId", getContentId());
051                    attributes.put("groupId", getGroupId());
052                    attributes.put("companyId", getCompanyId());
053                    attributes.put("userId", getUserId());
054                    attributes.put("userName", getUserName());
055                    attributes.put("createDate", getCreateDate());
056                    attributes.put("modifiedDate", getModifiedDate());
057                    attributes.put("name", getName());
058                    attributes.put("description", getDescription());
059                    attributes.put("xml", getXml());
060    
061                    return attributes;
062            }
063    
064            public void setModelAttributes(Map<String, Object> attributes) {
065                    String uuid = (String)attributes.get("uuid");
066    
067                    if (uuid != null) {
068                            setUuid(uuid);
069                    }
070    
071                    Long contentId = (Long)attributes.get("contentId");
072    
073                    if (contentId != null) {
074                            setContentId(contentId);
075                    }
076    
077                    Long groupId = (Long)attributes.get("groupId");
078    
079                    if (groupId != null) {
080                            setGroupId(groupId);
081                    }
082    
083                    Long companyId = (Long)attributes.get("companyId");
084    
085                    if (companyId != null) {
086                            setCompanyId(companyId);
087                    }
088    
089                    Long userId = (Long)attributes.get("userId");
090    
091                    if (userId != null) {
092                            setUserId(userId);
093                    }
094    
095                    String userName = (String)attributes.get("userName");
096    
097                    if (userName != null) {
098                            setUserName(userName);
099                    }
100    
101                    Date createDate = (Date)attributes.get("createDate");
102    
103                    if (createDate != null) {
104                            setCreateDate(createDate);
105                    }
106    
107                    Date modifiedDate = (Date)attributes.get("modifiedDate");
108    
109                    if (modifiedDate != null) {
110                            setModifiedDate(modifiedDate);
111                    }
112    
113                    String name = (String)attributes.get("name");
114    
115                    if (name != null) {
116                            setName(name);
117                    }
118    
119                    String description = (String)attributes.get("description");
120    
121                    if (description != null) {
122                            setDescription(description);
123                    }
124    
125                    String xml = (String)attributes.get("xml");
126    
127                    if (xml != null) {
128                            setXml(xml);
129                    }
130            }
131    
132            /**
133            * Returns the primary key of this d d m content.
134            *
135            * @return the primary key of this d d m content
136            */
137            public long getPrimaryKey() {
138                    return _ddmContent.getPrimaryKey();
139            }
140    
141            /**
142            * Sets the primary key of this d d m content.
143            *
144            * @param primaryKey the primary key of this d d m content
145            */
146            public void setPrimaryKey(long primaryKey) {
147                    _ddmContent.setPrimaryKey(primaryKey);
148            }
149    
150            /**
151            * Returns the uuid of this d d m content.
152            *
153            * @return the uuid of this d d m content
154            */
155            public java.lang.String getUuid() {
156                    return _ddmContent.getUuid();
157            }
158    
159            /**
160            * Sets the uuid of this d d m content.
161            *
162            * @param uuid the uuid of this d d m content
163            */
164            public void setUuid(java.lang.String uuid) {
165                    _ddmContent.setUuid(uuid);
166            }
167    
168            /**
169            * Returns the content ID of this d d m content.
170            *
171            * @return the content ID of this d d m content
172            */
173            public long getContentId() {
174                    return _ddmContent.getContentId();
175            }
176    
177            /**
178            * Sets the content ID of this d d m content.
179            *
180            * @param contentId the content ID of this d d m content
181            */
182            public void setContentId(long contentId) {
183                    _ddmContent.setContentId(contentId);
184            }
185    
186            /**
187            * Returns the group ID of this d d m content.
188            *
189            * @return the group ID of this d d m content
190            */
191            public long getGroupId() {
192                    return _ddmContent.getGroupId();
193            }
194    
195            /**
196            * Sets the group ID of this d d m content.
197            *
198            * @param groupId the group ID of this d d m content
199            */
200            public void setGroupId(long groupId) {
201                    _ddmContent.setGroupId(groupId);
202            }
203    
204            /**
205            * Returns the company ID of this d d m content.
206            *
207            * @return the company ID of this d d m content
208            */
209            public long getCompanyId() {
210                    return _ddmContent.getCompanyId();
211            }
212    
213            /**
214            * Sets the company ID of this d d m content.
215            *
216            * @param companyId the company ID of this d d m content
217            */
218            public void setCompanyId(long companyId) {
219                    _ddmContent.setCompanyId(companyId);
220            }
221    
222            /**
223            * Returns the user ID of this d d m content.
224            *
225            * @return the user ID of this d d m content
226            */
227            public long getUserId() {
228                    return _ddmContent.getUserId();
229            }
230    
231            /**
232            * Sets the user ID of this d d m content.
233            *
234            * @param userId the user ID of this d d m content
235            */
236            public void setUserId(long userId) {
237                    _ddmContent.setUserId(userId);
238            }
239    
240            /**
241            * Returns the user uuid of this d d m content.
242            *
243            * @return the user uuid of this d d m content
244            * @throws SystemException if a system exception occurred
245            */
246            public java.lang.String getUserUuid()
247                    throws com.liferay.portal.kernel.exception.SystemException {
248                    return _ddmContent.getUserUuid();
249            }
250    
251            /**
252            * Sets the user uuid of this d d m content.
253            *
254            * @param userUuid the user uuid of this d d m content
255            */
256            public void setUserUuid(java.lang.String userUuid) {
257                    _ddmContent.setUserUuid(userUuid);
258            }
259    
260            /**
261            * Returns the user name of this d d m content.
262            *
263            * @return the user name of this d d m content
264            */
265            public java.lang.String getUserName() {
266                    return _ddmContent.getUserName();
267            }
268    
269            /**
270            * Sets the user name of this d d m content.
271            *
272            * @param userName the user name of this d d m content
273            */
274            public void setUserName(java.lang.String userName) {
275                    _ddmContent.setUserName(userName);
276            }
277    
278            /**
279            * Returns the create date of this d d m content.
280            *
281            * @return the create date of this d d m content
282            */
283            public java.util.Date getCreateDate() {
284                    return _ddmContent.getCreateDate();
285            }
286    
287            /**
288            * Sets the create date of this d d m content.
289            *
290            * @param createDate the create date of this d d m content
291            */
292            public void setCreateDate(java.util.Date createDate) {
293                    _ddmContent.setCreateDate(createDate);
294            }
295    
296            /**
297            * Returns the modified date of this d d m content.
298            *
299            * @return the modified date of this d d m content
300            */
301            public java.util.Date getModifiedDate() {
302                    return _ddmContent.getModifiedDate();
303            }
304    
305            /**
306            * Sets the modified date of this d d m content.
307            *
308            * @param modifiedDate the modified date of this d d m content
309            */
310            public void setModifiedDate(java.util.Date modifiedDate) {
311                    _ddmContent.setModifiedDate(modifiedDate);
312            }
313    
314            /**
315            * Returns the name of this d d m content.
316            *
317            * @return the name of this d d m content
318            */
319            public java.lang.String getName() {
320                    return _ddmContent.getName();
321            }
322    
323            /**
324            * Returns the localized name of this d d m content in the language. Uses the default language if no localization exists for the requested language.
325            *
326            * @param locale the locale of the language
327            * @return the localized name of this d d m content
328            */
329            public java.lang.String getName(java.util.Locale locale) {
330                    return _ddmContent.getName(locale);
331            }
332    
333            /**
334            * Returns the localized name of this d d m content in the language, optionally using the default language if no localization exists for the requested language.
335            *
336            * @param locale the local of the language
337            * @param useDefault whether to use the default language if no localization exists for the requested language
338            * @return the localized name of this d d m content. If <code>useDefault</code> is <code>false</code> and no localization exists for the requested language, an empty string will be returned.
339            */
340            public java.lang.String getName(java.util.Locale locale, boolean useDefault) {
341                    return _ddmContent.getName(locale, useDefault);
342            }
343    
344            /**
345            * Returns the localized name of this d d m content in the language. Uses the default language if no localization exists for the requested language.
346            *
347            * @param languageId the ID of the language
348            * @return the localized name of this d d m content
349            */
350            public java.lang.String getName(java.lang.String languageId) {
351                    return _ddmContent.getName(languageId);
352            }
353    
354            /**
355            * Returns the localized name of this d d m content in the language, optionally using the default language if no localization exists for the requested language.
356            *
357            * @param languageId the ID of the language
358            * @param useDefault whether to use the default language if no localization exists for the requested language
359            * @return the localized name of this d d m content
360            */
361            public java.lang.String getName(java.lang.String languageId,
362                    boolean useDefault) {
363                    return _ddmContent.getName(languageId, useDefault);
364            }
365    
366            public java.lang.String getNameCurrentLanguageId() {
367                    return _ddmContent.getNameCurrentLanguageId();
368            }
369    
370            public java.lang.String getNameCurrentValue() {
371                    return _ddmContent.getNameCurrentValue();
372            }
373    
374            /**
375            * Returns a map of the locales and localized names of this d d m content.
376            *
377            * @return the locales and localized names of this d d m content
378            */
379            public java.util.Map<java.util.Locale, java.lang.String> getNameMap() {
380                    return _ddmContent.getNameMap();
381            }
382    
383            /**
384            * Sets the name of this d d m content.
385            *
386            * @param name the name of this d d m content
387            */
388            public void setName(java.lang.String name) {
389                    _ddmContent.setName(name);
390            }
391    
392            /**
393            * Sets the localized name of this d d m content in the language.
394            *
395            * @param name the localized name of this d d m content
396            * @param locale the locale of the language
397            */
398            public void setName(java.lang.String name, java.util.Locale locale) {
399                    _ddmContent.setName(name, locale);
400            }
401    
402            /**
403            * Sets the localized name of this d d m content in the language, and sets the default locale.
404            *
405            * @param name the localized name of this d d m content
406            * @param locale the locale of the language
407            * @param defaultLocale the default locale
408            */
409            public void setName(java.lang.String name, java.util.Locale locale,
410                    java.util.Locale defaultLocale) {
411                    _ddmContent.setName(name, locale, defaultLocale);
412            }
413    
414            public void setNameCurrentLanguageId(java.lang.String languageId) {
415                    _ddmContent.setNameCurrentLanguageId(languageId);
416            }
417    
418            /**
419            * Sets the localized names of this d d m content from the map of locales and localized names.
420            *
421            * @param nameMap the locales and localized names of this d d m content
422            */
423            public void setNameMap(
424                    java.util.Map<java.util.Locale, java.lang.String> nameMap) {
425                    _ddmContent.setNameMap(nameMap);
426            }
427    
428            /**
429            * Sets the localized names of this d d m content from the map of locales and localized names, and sets the default locale.
430            *
431            * @param nameMap the locales and localized names of this d d m content
432            * @param defaultLocale the default locale
433            */
434            public void setNameMap(
435                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
436                    java.util.Locale defaultLocale) {
437                    _ddmContent.setNameMap(nameMap, defaultLocale);
438            }
439    
440            /**
441            * Returns the description of this d d m content.
442            *
443            * @return the description of this d d m content
444            */
445            public java.lang.String getDescription() {
446                    return _ddmContent.getDescription();
447            }
448    
449            /**
450            * Sets the description of this d d m content.
451            *
452            * @param description the description of this d d m content
453            */
454            public void setDescription(java.lang.String description) {
455                    _ddmContent.setDescription(description);
456            }
457    
458            /**
459            * Returns the xml of this d d m content.
460            *
461            * @return the xml of this d d m content
462            */
463            public java.lang.String getXml() {
464                    return _ddmContent.getXml();
465            }
466    
467            /**
468            * Sets the xml of this d d m content.
469            *
470            * @param xml the xml of this d d m content
471            */
472            public void setXml(java.lang.String xml) {
473                    _ddmContent.setXml(xml);
474            }
475    
476            public boolean isNew() {
477                    return _ddmContent.isNew();
478            }
479    
480            public void setNew(boolean n) {
481                    _ddmContent.setNew(n);
482            }
483    
484            public boolean isCachedModel() {
485                    return _ddmContent.isCachedModel();
486            }
487    
488            public void setCachedModel(boolean cachedModel) {
489                    _ddmContent.setCachedModel(cachedModel);
490            }
491    
492            public boolean isEscapedModel() {
493                    return _ddmContent.isEscapedModel();
494            }
495    
496            public java.io.Serializable getPrimaryKeyObj() {
497                    return _ddmContent.getPrimaryKeyObj();
498            }
499    
500            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
501                    _ddmContent.setPrimaryKeyObj(primaryKeyObj);
502            }
503    
504            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
505                    return _ddmContent.getExpandoBridge();
506            }
507    
508            public void setExpandoBridgeAttributes(
509                    com.liferay.portal.service.ServiceContext serviceContext) {
510                    _ddmContent.setExpandoBridgeAttributes(serviceContext);
511            }
512    
513            public void prepareLocalizedFieldsForImport(
514                    java.util.Locale defaultImportLocale)
515                    throws com.liferay.portal.LocaleException {
516                    _ddmContent.prepareLocalizedFieldsForImport(defaultImportLocale);
517            }
518    
519            @Override
520            public java.lang.Object clone() {
521                    return new DDMContentWrapper((DDMContent)_ddmContent.clone());
522            }
523    
524            public int compareTo(
525                    com.liferay.portlet.dynamicdatamapping.model.DDMContent ddmContent) {
526                    return _ddmContent.compareTo(ddmContent);
527            }
528    
529            @Override
530            public int hashCode() {
531                    return _ddmContent.hashCode();
532            }
533    
534            public com.liferay.portal.model.CacheModel<com.liferay.portlet.dynamicdatamapping.model.DDMContent> toCacheModel() {
535                    return _ddmContent.toCacheModel();
536            }
537    
538            public com.liferay.portlet.dynamicdatamapping.model.DDMContent toEscapedModel() {
539                    return new DDMContentWrapper(_ddmContent.toEscapedModel());
540            }
541    
542            public com.liferay.portlet.dynamicdatamapping.model.DDMContent toUnescapedModel() {
543                    return new DDMContentWrapper(_ddmContent.toUnescapedModel());
544            }
545    
546            @Override
547            public java.lang.String toString() {
548                    return _ddmContent.toString();
549            }
550    
551            public java.lang.String toXmlString() {
552                    return _ddmContent.toXmlString();
553            }
554    
555            public void persist()
556                    throws com.liferay.portal.kernel.exception.SystemException {
557                    _ddmContent.persist();
558            }
559    
560            @Override
561            public boolean equals(Object obj) {
562                    if (this == obj) {
563                            return true;
564                    }
565    
566                    if (!(obj instanceof DDMContentWrapper)) {
567                            return false;
568                    }
569    
570                    DDMContentWrapper ddmContentWrapper = (DDMContentWrapper)obj;
571    
572                    if (Validator.equals(_ddmContent, ddmContentWrapper._ddmContent)) {
573                            return true;
574                    }
575    
576                    return false;
577            }
578    
579            /**
580             * @deprecated Renamed to {@link #getWrappedModel}
581             */
582            public DDMContent getWrappedDDMContent() {
583                    return _ddmContent;
584            }
585    
586            public DDMContent getWrappedModel() {
587                    return _ddmContent;
588            }
589    
590            public void resetOriginalValues() {
591                    _ddmContent.resetOriginalValues();
592            }
593    
594            private DDMContent _ddmContent;
595    }