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