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