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