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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.lar.StagedModelType;
020    import com.liferay.portal.kernel.util.Validator;
021    import com.liferay.portal.model.ModelWrapper;
022    
023    import java.util.Date;
024    import java.util.HashMap;
025    import java.util.Map;
026    
027    /**
028     * <p>
029     * This class is a wrapper for {@link DDMContent}.
030     * </p>
031     *
032     * @author Brian Wing Shun Chan
033     * @see DDMContent
034     * @generated
035     */
036    @ProviderType
037    public class DDMContentWrapper implements DDMContent, ModelWrapper<DDMContent> {
038            public DDMContentWrapper(DDMContent ddmContent) {
039                    _ddmContent = ddmContent;
040            }
041    
042            @Override
043            public Class<?> getModelClass() {
044                    return DDMContent.class;
045            }
046    
047            @Override
048            public String getModelClassName() {
049                    return DDMContent.class.getName();
050            }
051    
052            @Override
053            public Map<String, Object> getModelAttributes() {
054                    Map<String, Object> attributes = new HashMap<String, Object>();
055    
056                    attributes.put("uuid", getUuid());
057                    attributes.put("contentId", getContentId());
058                    attributes.put("groupId", getGroupId());
059                    attributes.put("companyId", getCompanyId());
060                    attributes.put("userId", getUserId());
061                    attributes.put("userName", getUserName());
062                    attributes.put("createDate", getCreateDate());
063                    attributes.put("modifiedDate", getModifiedDate());
064                    attributes.put("name", getName());
065                    attributes.put("description", getDescription());
066                    attributes.put("xml", getXml());
067    
068                    return attributes;
069            }
070    
071            @Override
072            public void setModelAttributes(Map<String, Object> attributes) {
073                    String uuid = (String)attributes.get("uuid");
074    
075                    if (uuid != null) {
076                            setUuid(uuid);
077                    }
078    
079                    Long contentId = (Long)attributes.get("contentId");
080    
081                    if (contentId != null) {
082                            setContentId(contentId);
083                    }
084    
085                    Long groupId = (Long)attributes.get("groupId");
086    
087                    if (groupId != null) {
088                            setGroupId(groupId);
089                    }
090    
091                    Long companyId = (Long)attributes.get("companyId");
092    
093                    if (companyId != null) {
094                            setCompanyId(companyId);
095                    }
096    
097                    Long userId = (Long)attributes.get("userId");
098    
099                    if (userId != null) {
100                            setUserId(userId);
101                    }
102    
103                    String userName = (String)attributes.get("userName");
104    
105                    if (userName != null) {
106                            setUserName(userName);
107                    }
108    
109                    Date createDate = (Date)attributes.get("createDate");
110    
111                    if (createDate != null) {
112                            setCreateDate(createDate);
113                    }
114    
115                    Date modifiedDate = (Date)attributes.get("modifiedDate");
116    
117                    if (modifiedDate != null) {
118                            setModifiedDate(modifiedDate);
119                    }
120    
121                    String name = (String)attributes.get("name");
122    
123                    if (name != null) {
124                            setName(name);
125                    }
126    
127                    String description = (String)attributes.get("description");
128    
129                    if (description != null) {
130                            setDescription(description);
131                    }
132    
133                    String xml = (String)attributes.get("xml");
134    
135                    if (xml != null) {
136                            setXml(xml);
137                    }
138            }
139    
140            /**
141            * Returns the primary key of this d d m content.
142            *
143            * @return the primary key of this d d m content
144            */
145            @Override
146            public long getPrimaryKey() {
147                    return _ddmContent.getPrimaryKey();
148            }
149    
150            /**
151            * Sets the primary key of this d d m content.
152            *
153            * @param primaryKey the primary key of this d d m content
154            */
155            @Override
156            public void setPrimaryKey(long primaryKey) {
157                    _ddmContent.setPrimaryKey(primaryKey);
158            }
159    
160            /**
161            * Returns the uuid of this d d m content.
162            *
163            * @return the uuid of this d d m content
164            */
165            @Override
166            public java.lang.String getUuid() {
167                    return _ddmContent.getUuid();
168            }
169    
170            /**
171            * Sets the uuid of this d d m content.
172            *
173            * @param uuid the uuid of this d d m content
174            */
175            @Override
176            public void setUuid(java.lang.String uuid) {
177                    _ddmContent.setUuid(uuid);
178            }
179    
180            /**
181            * Returns the content ID of this d d m content.
182            *
183            * @return the content ID of this d d m content
184            */
185            @Override
186            public long getContentId() {
187                    return _ddmContent.getContentId();
188            }
189    
190            /**
191            * Sets the content ID of this d d m content.
192            *
193            * @param contentId the content ID of this d d m content
194            */
195            @Override
196            public void setContentId(long contentId) {
197                    _ddmContent.setContentId(contentId);
198            }
199    
200            /**
201            * Returns the group ID of this d d m content.
202            *
203            * @return the group ID of this d d m content
204            */
205            @Override
206            public long getGroupId() {
207                    return _ddmContent.getGroupId();
208            }
209    
210            /**
211            * Sets the group ID of this d d m content.
212            *
213            * @param groupId the group ID of this d d m content
214            */
215            @Override
216            public void setGroupId(long groupId) {
217                    _ddmContent.setGroupId(groupId);
218            }
219    
220            /**
221            * Returns the company ID of this d d m content.
222            *
223            * @return the company ID of this d d m content
224            */
225            @Override
226            public long getCompanyId() {
227                    return _ddmContent.getCompanyId();
228            }
229    
230            /**
231            * Sets the company ID of this d d m content.
232            *
233            * @param companyId the company ID of this d d m content
234            */
235            @Override
236            public void setCompanyId(long companyId) {
237                    _ddmContent.setCompanyId(companyId);
238            }
239    
240            /**
241            * Returns the user ID of this d d m content.
242            *
243            * @return the user ID of this d d m content
244            */
245            @Override
246            public long getUserId() {
247                    return _ddmContent.getUserId();
248            }
249    
250            /**
251            * Sets the user ID of this d d m content.
252            *
253            * @param userId the user ID of this d d m content
254            */
255            @Override
256            public void setUserId(long userId) {
257                    _ddmContent.setUserId(userId);
258            }
259    
260            /**
261            * Returns the user uuid of this d d m content.
262            *
263            * @return the user uuid of this d d m content
264            * @throws SystemException if a system exception occurred
265            */
266            @Override
267            public java.lang.String getUserUuid()
268                    throws com.liferay.portal.kernel.exception.SystemException {
269                    return _ddmContent.getUserUuid();
270            }
271    
272            /**
273            * Sets the user uuid of this d d m content.
274            *
275            * @param userUuid the user uuid of this d d m content
276            */
277            @Override
278            public void setUserUuid(java.lang.String userUuid) {
279                    _ddmContent.setUserUuid(userUuid);
280            }
281    
282            /**
283            * Returns the user name of this d d m content.
284            *
285            * @return the user name of this d d m content
286            */
287            @Override
288            public java.lang.String getUserName() {
289                    return _ddmContent.getUserName();
290            }
291    
292            /**
293            * Sets the user name of this d d m content.
294            *
295            * @param userName the user name of this d d m content
296            */
297            @Override
298            public void setUserName(java.lang.String userName) {
299                    _ddmContent.setUserName(userName);
300            }
301    
302            /**
303            * Returns the create date of this d d m content.
304            *
305            * @return the create date of this d d m content
306            */
307            @Override
308            public java.util.Date getCreateDate() {
309                    return _ddmContent.getCreateDate();
310            }
311    
312            /**
313            * Sets the create date of this d d m content.
314            *
315            * @param createDate the create date of this d d m content
316            */
317            @Override
318            public void setCreateDate(java.util.Date createDate) {
319                    _ddmContent.setCreateDate(createDate);
320            }
321    
322            /**
323            * Returns the modified date of this d d m content.
324            *
325            * @return the modified date of this d d m content
326            */
327            @Override
328            public java.util.Date getModifiedDate() {
329                    return _ddmContent.getModifiedDate();
330            }
331    
332            /**
333            * Sets the modified date of this d d m content.
334            *
335            * @param modifiedDate the modified date of this d d m content
336            */
337            @Override
338            public void setModifiedDate(java.util.Date modifiedDate) {
339                    _ddmContent.setModifiedDate(modifiedDate);
340            }
341    
342            /**
343            * Returns the name of this d d m content.
344            *
345            * @return the name of this d d m content
346            */
347            @Override
348            public java.lang.String getName() {
349                    return _ddmContent.getName();
350            }
351    
352            /**
353            * 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.
354            *
355            * @param locale the locale of the language
356            * @return the localized name of this d d m content
357            */
358            @Override
359            public java.lang.String getName(java.util.Locale locale) {
360                    return _ddmContent.getName(locale);
361            }
362    
363            /**
364            * 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.
365            *
366            * @param locale the local of the language
367            * @param useDefault whether to use the default language if no localization exists for the requested language
368            * @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.
369            */
370            @Override
371            public java.lang.String getName(java.util.Locale locale, boolean useDefault) {
372                    return _ddmContent.getName(locale, useDefault);
373            }
374    
375            /**
376            * 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.
377            *
378            * @param languageId the ID of the language
379            * @return the localized name of this d d m content
380            */
381            @Override
382            public java.lang.String getName(java.lang.String languageId) {
383                    return _ddmContent.getName(languageId);
384            }
385    
386            /**
387            * 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.
388            *
389            * @param languageId the ID of the language
390            * @param useDefault whether to use the default language if no localization exists for the requested language
391            * @return the localized name of this d d m content
392            */
393            @Override
394            public java.lang.String getName(java.lang.String languageId,
395                    boolean useDefault) {
396                    return _ddmContent.getName(languageId, useDefault);
397            }
398    
399            @Override
400            public java.lang.String getNameCurrentLanguageId() {
401                    return _ddmContent.getNameCurrentLanguageId();
402            }
403    
404            @Override
405            public java.lang.String getNameCurrentValue() {
406                    return _ddmContent.getNameCurrentValue();
407            }
408    
409            /**
410            * Returns a map of the locales and localized names of this d d m content.
411            *
412            * @return the locales and localized names of this d d m content
413            */
414            @Override
415            public java.util.Map<java.util.Locale, java.lang.String> getNameMap() {
416                    return _ddmContent.getNameMap();
417            }
418    
419            /**
420            * Sets the name of this d d m content.
421            *
422            * @param name the name of this d d m content
423            */
424            @Override
425            public void setName(java.lang.String name) {
426                    _ddmContent.setName(name);
427            }
428    
429            /**
430            * Sets the localized name of this d d m content in the language.
431            *
432            * @param name the localized name of this d d m content
433            * @param locale the locale of the language
434            */
435            @Override
436            public void setName(java.lang.String name, java.util.Locale locale) {
437                    _ddmContent.setName(name, locale);
438            }
439    
440            /**
441            * Sets the localized name of this d d m content in the language, and sets the default locale.
442            *
443            * @param name the localized name of this d d m content
444            * @param locale the locale of the language
445            * @param defaultLocale the default locale
446            */
447            @Override
448            public void setName(java.lang.String name, java.util.Locale locale,
449                    java.util.Locale defaultLocale) {
450                    _ddmContent.setName(name, locale, defaultLocale);
451            }
452    
453            @Override
454            public void setNameCurrentLanguageId(java.lang.String languageId) {
455                    _ddmContent.setNameCurrentLanguageId(languageId);
456            }
457    
458            /**
459            * Sets the localized names of this d d m content from the map of locales and localized names.
460            *
461            * @param nameMap the locales and localized names of this d d m content
462            */
463            @Override
464            public void setNameMap(
465                    java.util.Map<java.util.Locale, java.lang.String> nameMap) {
466                    _ddmContent.setNameMap(nameMap);
467            }
468    
469            /**
470            * Sets the localized names of this d d m content from the map of locales and localized names, and sets the default locale.
471            *
472            * @param nameMap the locales and localized names of this d d m content
473            * @param defaultLocale the default locale
474            */
475            @Override
476            public void setNameMap(
477                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
478                    java.util.Locale defaultLocale) {
479                    _ddmContent.setNameMap(nameMap, defaultLocale);
480            }
481    
482            /**
483            * Returns the description of this d d m content.
484            *
485            * @return the description of this d d m content
486            */
487            @Override
488            public java.lang.String getDescription() {
489                    return _ddmContent.getDescription();
490            }
491    
492            /**
493            * Sets the description of this d d m content.
494            *
495            * @param description the description of this d d m content
496            */
497            @Override
498            public void setDescription(java.lang.String description) {
499                    _ddmContent.setDescription(description);
500            }
501    
502            /**
503            * Returns the xml of this d d m content.
504            *
505            * @return the xml of this d d m content
506            */
507            @Override
508            public java.lang.String getXml() {
509                    return _ddmContent.getXml();
510            }
511    
512            /**
513            * Sets the xml of this d d m content.
514            *
515            * @param xml the xml of this d d m content
516            */
517            @Override
518            public void setXml(java.lang.String xml) {
519                    _ddmContent.setXml(xml);
520            }
521    
522            @Override
523            public boolean isNew() {
524                    return _ddmContent.isNew();
525            }
526    
527            @Override
528            public void setNew(boolean n) {
529                    _ddmContent.setNew(n);
530            }
531    
532            @Override
533            public boolean isCachedModel() {
534                    return _ddmContent.isCachedModel();
535            }
536    
537            @Override
538            public void setCachedModel(boolean cachedModel) {
539                    _ddmContent.setCachedModel(cachedModel);
540            }
541    
542            @Override
543            public boolean isEscapedModel() {
544                    return _ddmContent.isEscapedModel();
545            }
546    
547            @Override
548            public java.io.Serializable getPrimaryKeyObj() {
549                    return _ddmContent.getPrimaryKeyObj();
550            }
551    
552            @Override
553            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
554                    _ddmContent.setPrimaryKeyObj(primaryKeyObj);
555            }
556    
557            @Override
558            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
559                    return _ddmContent.getExpandoBridge();
560            }
561    
562            @Override
563            public void setExpandoBridgeAttributes(
564                    com.liferay.portal.model.BaseModel<?> baseModel) {
565                    _ddmContent.setExpandoBridgeAttributes(baseModel);
566            }
567    
568            @Override
569            public void setExpandoBridgeAttributes(
570                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
571                    _ddmContent.setExpandoBridgeAttributes(expandoBridge);
572            }
573    
574            @Override
575            public void setExpandoBridgeAttributes(
576                    com.liferay.portal.service.ServiceContext serviceContext) {
577                    _ddmContent.setExpandoBridgeAttributes(serviceContext);
578            }
579    
580            @Override
581            public java.lang.String[] getAvailableLanguageIds() {
582                    return _ddmContent.getAvailableLanguageIds();
583            }
584    
585            @Override
586            public java.lang.String getDefaultLanguageId() {
587                    return _ddmContent.getDefaultLanguageId();
588            }
589    
590            @Override
591            public void prepareLocalizedFieldsForImport()
592                    throws com.liferay.portal.LocaleException {
593                    _ddmContent.prepareLocalizedFieldsForImport();
594            }
595    
596            @Override
597            public void prepareLocalizedFieldsForImport(
598                    java.util.Locale defaultImportLocale)
599                    throws com.liferay.portal.LocaleException {
600                    _ddmContent.prepareLocalizedFieldsForImport(defaultImportLocale);
601            }
602    
603            @Override
604            public java.lang.Object clone() {
605                    return new DDMContentWrapper((DDMContent)_ddmContent.clone());
606            }
607    
608            @Override
609            public int compareTo(
610                    com.liferay.portlet.dynamicdatamapping.model.DDMContent ddmContent) {
611                    return _ddmContent.compareTo(ddmContent);
612            }
613    
614            @Override
615            public int hashCode() {
616                    return _ddmContent.hashCode();
617            }
618    
619            @Override
620            public com.liferay.portal.model.CacheModel<com.liferay.portlet.dynamicdatamapping.model.DDMContent> toCacheModel() {
621                    return _ddmContent.toCacheModel();
622            }
623    
624            @Override
625            public com.liferay.portlet.dynamicdatamapping.model.DDMContent toEscapedModel() {
626                    return new DDMContentWrapper(_ddmContent.toEscapedModel());
627            }
628    
629            @Override
630            public com.liferay.portlet.dynamicdatamapping.model.DDMContent toUnescapedModel() {
631                    return new DDMContentWrapper(_ddmContent.toUnescapedModel());
632            }
633    
634            @Override
635            public java.lang.String toString() {
636                    return _ddmContent.toString();
637            }
638    
639            @Override
640            public java.lang.String toXmlString() {
641                    return _ddmContent.toXmlString();
642            }
643    
644            @Override
645            public void persist()
646                    throws com.liferay.portal.kernel.exception.SystemException {
647                    _ddmContent.persist();
648            }
649    
650            @Override
651            public boolean equals(Object obj) {
652                    if (this == obj) {
653                            return true;
654                    }
655    
656                    if (!(obj instanceof DDMContentWrapper)) {
657                            return false;
658                    }
659    
660                    DDMContentWrapper ddmContentWrapper = (DDMContentWrapper)obj;
661    
662                    if (Validator.equals(_ddmContent, ddmContentWrapper._ddmContent)) {
663                            return true;
664                    }
665    
666                    return false;
667            }
668    
669            @Override
670            public StagedModelType getStagedModelType() {
671                    return _ddmContent.getStagedModelType();
672            }
673    
674            /**
675             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
676             */
677            public DDMContent getWrappedDDMContent() {
678                    return _ddmContent;
679            }
680    
681            @Override
682            public DDMContent getWrappedModel() {
683                    return _ddmContent;
684            }
685    
686            @Override
687            public void resetOriginalValues() {
688                    _ddmContent.resetOriginalValues();
689            }
690    
691            private DDMContent _ddmContent;
692    }