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