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.util.Validator;
018    import com.liferay.portal.model.ModelWrapper;
019    
020    import java.util.Date;
021    import java.util.HashMap;
022    import java.util.Map;
023    
024    /**
025     * <p>
026     * This class is a wrapper for {@link DDMTemplate}.
027     * </p>
028     *
029     * @author    Brian Wing Shun Chan
030     * @see       DDMTemplate
031     * @generated
032     */
033    public class DDMTemplateWrapper implements DDMTemplate,
034            ModelWrapper<DDMTemplate> {
035            public DDMTemplateWrapper(DDMTemplate ddmTemplate) {
036                    _ddmTemplate = ddmTemplate;
037            }
038    
039            public Class<?> getModelClass() {
040                    return DDMTemplate.class;
041            }
042    
043            public String getModelClassName() {
044                    return DDMTemplate.class.getName();
045            }
046    
047            public Map<String, Object> getModelAttributes() {
048                    Map<String, Object> attributes = new HashMap<String, Object>();
049    
050                    attributes.put("uuid", getUuid());
051                    attributes.put("templateId", getTemplateId());
052                    attributes.put("groupId", getGroupId());
053                    attributes.put("companyId", getCompanyId());
054                    attributes.put("userId", getUserId());
055                    attributes.put("userName", getUserName());
056                    attributes.put("createDate", getCreateDate());
057                    attributes.put("modifiedDate", getModifiedDate());
058                    attributes.put("structureId", getStructureId());
059                    attributes.put("name", getName());
060                    attributes.put("description", getDescription());
061                    attributes.put("type", getType());
062                    attributes.put("mode", getMode());
063                    attributes.put("language", getLanguage());
064                    attributes.put("script", getScript());
065    
066                    return attributes;
067            }
068    
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 templateId = (Long)attributes.get("templateId");
077    
078                    if (templateId != null) {
079                            setTemplateId(templateId);
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                    Long structureId = (Long)attributes.get("structureId");
119    
120                    if (structureId != null) {
121                            setStructureId(structureId);
122                    }
123    
124                    String name = (String)attributes.get("name");
125    
126                    if (name != null) {
127                            setName(name);
128                    }
129    
130                    String description = (String)attributes.get("description");
131    
132                    if (description != null) {
133                            setDescription(description);
134                    }
135    
136                    String type = (String)attributes.get("type");
137    
138                    if (type != null) {
139                            setType(type);
140                    }
141    
142                    String mode = (String)attributes.get("mode");
143    
144                    if (mode != null) {
145                            setMode(mode);
146                    }
147    
148                    String language = (String)attributes.get("language");
149    
150                    if (language != null) {
151                            setLanguage(language);
152                    }
153    
154                    String script = (String)attributes.get("script");
155    
156                    if (script != null) {
157                            setScript(script);
158                    }
159            }
160    
161            /**
162            * Returns the primary key of this d d m template.
163            *
164            * @return the primary key of this d d m template
165            */
166            public long getPrimaryKey() {
167                    return _ddmTemplate.getPrimaryKey();
168            }
169    
170            /**
171            * Sets the primary key of this d d m template.
172            *
173            * @param primaryKey the primary key of this d d m template
174            */
175            public void setPrimaryKey(long primaryKey) {
176                    _ddmTemplate.setPrimaryKey(primaryKey);
177            }
178    
179            /**
180            * Returns the uuid of this d d m template.
181            *
182            * @return the uuid of this d d m template
183            */
184            public java.lang.String getUuid() {
185                    return _ddmTemplate.getUuid();
186            }
187    
188            /**
189            * Sets the uuid of this d d m template.
190            *
191            * @param uuid the uuid of this d d m template
192            */
193            public void setUuid(java.lang.String uuid) {
194                    _ddmTemplate.setUuid(uuid);
195            }
196    
197            /**
198            * Returns the template ID of this d d m template.
199            *
200            * @return the template ID of this d d m template
201            */
202            public long getTemplateId() {
203                    return _ddmTemplate.getTemplateId();
204            }
205    
206            /**
207            * Sets the template ID of this d d m template.
208            *
209            * @param templateId the template ID of this d d m template
210            */
211            public void setTemplateId(long templateId) {
212                    _ddmTemplate.setTemplateId(templateId);
213            }
214    
215            /**
216            * Returns the group ID of this d d m template.
217            *
218            * @return the group ID of this d d m template
219            */
220            public long getGroupId() {
221                    return _ddmTemplate.getGroupId();
222            }
223    
224            /**
225            * Sets the group ID of this d d m template.
226            *
227            * @param groupId the group ID of this d d m template
228            */
229            public void setGroupId(long groupId) {
230                    _ddmTemplate.setGroupId(groupId);
231            }
232    
233            /**
234            * Returns the company ID of this d d m template.
235            *
236            * @return the company ID of this d d m template
237            */
238            public long getCompanyId() {
239                    return _ddmTemplate.getCompanyId();
240            }
241    
242            /**
243            * Sets the company ID of this d d m template.
244            *
245            * @param companyId the company ID of this d d m template
246            */
247            public void setCompanyId(long companyId) {
248                    _ddmTemplate.setCompanyId(companyId);
249            }
250    
251            /**
252            * Returns the user ID of this d d m template.
253            *
254            * @return the user ID of this d d m template
255            */
256            public long getUserId() {
257                    return _ddmTemplate.getUserId();
258            }
259    
260            /**
261            * Sets the user ID of this d d m template.
262            *
263            * @param userId the user ID of this d d m template
264            */
265            public void setUserId(long userId) {
266                    _ddmTemplate.setUserId(userId);
267            }
268    
269            /**
270            * Returns the user uuid of this d d m template.
271            *
272            * @return the user uuid of this d d m template
273            * @throws SystemException if a system exception occurred
274            */
275            public java.lang.String getUserUuid()
276                    throws com.liferay.portal.kernel.exception.SystemException {
277                    return _ddmTemplate.getUserUuid();
278            }
279    
280            /**
281            * Sets the user uuid of this d d m template.
282            *
283            * @param userUuid the user uuid of this d d m template
284            */
285            public void setUserUuid(java.lang.String userUuid) {
286                    _ddmTemplate.setUserUuid(userUuid);
287            }
288    
289            /**
290            * Returns the user name of this d d m template.
291            *
292            * @return the user name of this d d m template
293            */
294            public java.lang.String getUserName() {
295                    return _ddmTemplate.getUserName();
296            }
297    
298            /**
299            * Sets the user name of this d d m template.
300            *
301            * @param userName the user name of this d d m template
302            */
303            public void setUserName(java.lang.String userName) {
304                    _ddmTemplate.setUserName(userName);
305            }
306    
307            /**
308            * Returns the create date of this d d m template.
309            *
310            * @return the create date of this d d m template
311            */
312            public java.util.Date getCreateDate() {
313                    return _ddmTemplate.getCreateDate();
314            }
315    
316            /**
317            * Sets the create date of this d d m template.
318            *
319            * @param createDate the create date of this d d m template
320            */
321            public void setCreateDate(java.util.Date createDate) {
322                    _ddmTemplate.setCreateDate(createDate);
323            }
324    
325            /**
326            * Returns the modified date of this d d m template.
327            *
328            * @return the modified date of this d d m template
329            */
330            public java.util.Date getModifiedDate() {
331                    return _ddmTemplate.getModifiedDate();
332            }
333    
334            /**
335            * Sets the modified date of this d d m template.
336            *
337            * @param modifiedDate the modified date of this d d m template
338            */
339            public void setModifiedDate(java.util.Date modifiedDate) {
340                    _ddmTemplate.setModifiedDate(modifiedDate);
341            }
342    
343            /**
344            * Returns the structure ID of this d d m template.
345            *
346            * @return the structure ID of this d d m template
347            */
348            public long getStructureId() {
349                    return _ddmTemplate.getStructureId();
350            }
351    
352            /**
353            * Sets the structure ID of this d d m template.
354            *
355            * @param structureId the structure ID of this d d m template
356            */
357            public void setStructureId(long structureId) {
358                    _ddmTemplate.setStructureId(structureId);
359            }
360    
361            /**
362            * Returns the name of this d d m template.
363            *
364            * @return the name of this d d m template
365            */
366            public java.lang.String getName() {
367                    return _ddmTemplate.getName();
368            }
369    
370            /**
371            * Returns the localized name of this d d m template in the language. Uses the default language if no localization exists for the requested language.
372            *
373            * @param locale the locale of the language
374            * @return the localized name of this d d m template
375            */
376            public java.lang.String getName(java.util.Locale locale) {
377                    return _ddmTemplate.getName(locale);
378            }
379    
380            /**
381            * Returns the localized name of this d d m template in the language, optionally using the default language if no localization exists for the requested language.
382            *
383            * @param locale the local of the language
384            * @param useDefault whether to use the default language if no localization exists for the requested language
385            * @return the localized name of this d d m template. If <code>useDefault</code> is <code>false</code> and no localization exists for the requested language, an empty string will be returned.
386            */
387            public java.lang.String getName(java.util.Locale locale, boolean useDefault) {
388                    return _ddmTemplate.getName(locale, useDefault);
389            }
390    
391            /**
392            * Returns the localized name of this d d m template in the language. Uses the default language if no localization exists for the requested language.
393            *
394            * @param languageId the ID of the language
395            * @return the localized name of this d d m template
396            */
397            public java.lang.String getName(java.lang.String languageId) {
398                    return _ddmTemplate.getName(languageId);
399            }
400    
401            /**
402            * Returns the localized name of this d d m template in the language, optionally using the default language if no localization exists for the requested language.
403            *
404            * @param languageId the ID of the language
405            * @param useDefault whether to use the default language if no localization exists for the requested language
406            * @return the localized name of this d d m template
407            */
408            public java.lang.String getName(java.lang.String languageId,
409                    boolean useDefault) {
410                    return _ddmTemplate.getName(languageId, useDefault);
411            }
412    
413            public java.lang.String getNameCurrentLanguageId() {
414                    return _ddmTemplate.getNameCurrentLanguageId();
415            }
416    
417            public java.lang.String getNameCurrentValue() {
418                    return _ddmTemplate.getNameCurrentValue();
419            }
420    
421            /**
422            * Returns a map of the locales and localized names of this d d m template.
423            *
424            * @return the locales and localized names of this d d m template
425            */
426            public java.util.Map<java.util.Locale, java.lang.String> getNameMap() {
427                    return _ddmTemplate.getNameMap();
428            }
429    
430            /**
431            * Sets the name of this d d m template.
432            *
433            * @param name the name of this d d m template
434            */
435            public void setName(java.lang.String name) {
436                    _ddmTemplate.setName(name);
437            }
438    
439            /**
440            * Sets the localized name of this d d m template in the language.
441            *
442            * @param name the localized name of this d d m template
443            * @param locale the locale of the language
444            */
445            public void setName(java.lang.String name, java.util.Locale locale) {
446                    _ddmTemplate.setName(name, locale);
447            }
448    
449            /**
450            * Sets the localized name of this d d m template in the language, and sets the default locale.
451            *
452            * @param name the localized name of this d d m template
453            * @param locale the locale of the language
454            * @param defaultLocale the default locale
455            */
456            public void setName(java.lang.String name, java.util.Locale locale,
457                    java.util.Locale defaultLocale) {
458                    _ddmTemplate.setName(name, locale, defaultLocale);
459            }
460    
461            public void setNameCurrentLanguageId(java.lang.String languageId) {
462                    _ddmTemplate.setNameCurrentLanguageId(languageId);
463            }
464    
465            /**
466            * Sets the localized names of this d d m template from the map of locales and localized names.
467            *
468            * @param nameMap the locales and localized names of this d d m template
469            */
470            public void setNameMap(
471                    java.util.Map<java.util.Locale, java.lang.String> nameMap) {
472                    _ddmTemplate.setNameMap(nameMap);
473            }
474    
475            /**
476            * Sets the localized names of this d d m template from the map of locales and localized names, and sets the default locale.
477            *
478            * @param nameMap the locales and localized names of this d d m template
479            * @param defaultLocale the default locale
480            */
481            public void setNameMap(
482                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
483                    java.util.Locale defaultLocale) {
484                    _ddmTemplate.setNameMap(nameMap, defaultLocale);
485            }
486    
487            /**
488            * Returns the description of this d d m template.
489            *
490            * @return the description of this d d m template
491            */
492            public java.lang.String getDescription() {
493                    return _ddmTemplate.getDescription();
494            }
495    
496            /**
497            * Returns the localized description of this d d m template in the language. Uses the default language if no localization exists for the requested language.
498            *
499            * @param locale the locale of the language
500            * @return the localized description of this d d m template
501            */
502            public java.lang.String getDescription(java.util.Locale locale) {
503                    return _ddmTemplate.getDescription(locale);
504            }
505    
506            /**
507            * Returns the localized description of this d d m template in the language, optionally using the default language if no localization exists for the requested language.
508            *
509            * @param locale the local of the language
510            * @param useDefault whether to use the default language if no localization exists for the requested language
511            * @return the localized description of this d d m template. If <code>useDefault</code> is <code>false</code> and no localization exists for the requested language, an empty string will be returned.
512            */
513            public java.lang.String getDescription(java.util.Locale locale,
514                    boolean useDefault) {
515                    return _ddmTemplate.getDescription(locale, useDefault);
516            }
517    
518            /**
519            * Returns the localized description of this d d m template in the language. Uses the default language if no localization exists for the requested language.
520            *
521            * @param languageId the ID of the language
522            * @return the localized description of this d d m template
523            */
524            public java.lang.String getDescription(java.lang.String languageId) {
525                    return _ddmTemplate.getDescription(languageId);
526            }
527    
528            /**
529            * Returns the localized description of this d d m template in the language, optionally using the default language if no localization exists for the requested language.
530            *
531            * @param languageId the ID of the language
532            * @param useDefault whether to use the default language if no localization exists for the requested language
533            * @return the localized description of this d d m template
534            */
535            public java.lang.String getDescription(java.lang.String languageId,
536                    boolean useDefault) {
537                    return _ddmTemplate.getDescription(languageId, useDefault);
538            }
539    
540            public java.lang.String getDescriptionCurrentLanguageId() {
541                    return _ddmTemplate.getDescriptionCurrentLanguageId();
542            }
543    
544            public java.lang.String getDescriptionCurrentValue() {
545                    return _ddmTemplate.getDescriptionCurrentValue();
546            }
547    
548            /**
549            * Returns a map of the locales and localized descriptions of this d d m template.
550            *
551            * @return the locales and localized descriptions of this d d m template
552            */
553            public java.util.Map<java.util.Locale, java.lang.String> getDescriptionMap() {
554                    return _ddmTemplate.getDescriptionMap();
555            }
556    
557            /**
558            * Sets the description of this d d m template.
559            *
560            * @param description the description of this d d m template
561            */
562            public void setDescription(java.lang.String description) {
563                    _ddmTemplate.setDescription(description);
564            }
565    
566            /**
567            * Sets the localized description of this d d m template in the language.
568            *
569            * @param description the localized description of this d d m template
570            * @param locale the locale of the language
571            */
572            public void setDescription(java.lang.String description,
573                    java.util.Locale locale) {
574                    _ddmTemplate.setDescription(description, locale);
575            }
576    
577            /**
578            * Sets the localized description of this d d m template in the language, and sets the default locale.
579            *
580            * @param description the localized description of this d d m template
581            * @param locale the locale of the language
582            * @param defaultLocale the default locale
583            */
584            public void setDescription(java.lang.String description,
585                    java.util.Locale locale, java.util.Locale defaultLocale) {
586                    _ddmTemplate.setDescription(description, locale, defaultLocale);
587            }
588    
589            public void setDescriptionCurrentLanguageId(java.lang.String languageId) {
590                    _ddmTemplate.setDescriptionCurrentLanguageId(languageId);
591            }
592    
593            /**
594            * Sets the localized descriptions of this d d m template from the map of locales and localized descriptions.
595            *
596            * @param descriptionMap the locales and localized descriptions of this d d m template
597            */
598            public void setDescriptionMap(
599                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap) {
600                    _ddmTemplate.setDescriptionMap(descriptionMap);
601            }
602    
603            /**
604            * Sets the localized descriptions of this d d m template from the map of locales and localized descriptions, and sets the default locale.
605            *
606            * @param descriptionMap the locales and localized descriptions of this d d m template
607            * @param defaultLocale the default locale
608            */
609            public void setDescriptionMap(
610                    java.util.Map<java.util.Locale, java.lang.String> descriptionMap,
611                    java.util.Locale defaultLocale) {
612                    _ddmTemplate.setDescriptionMap(descriptionMap, defaultLocale);
613            }
614    
615            /**
616            * Returns the type of this d d m template.
617            *
618            * @return the type of this d d m template
619            */
620            public java.lang.String getType() {
621                    return _ddmTemplate.getType();
622            }
623    
624            /**
625            * Sets the type of this d d m template.
626            *
627            * @param type the type of this d d m template
628            */
629            public void setType(java.lang.String type) {
630                    _ddmTemplate.setType(type);
631            }
632    
633            /**
634            * Returns the mode of this d d m template.
635            *
636            * @return the mode of this d d m template
637            */
638            public java.lang.String getMode() {
639                    return _ddmTemplate.getMode();
640            }
641    
642            /**
643            * Sets the mode of this d d m template.
644            *
645            * @param mode the mode of this d d m template
646            */
647            public void setMode(java.lang.String mode) {
648                    _ddmTemplate.setMode(mode);
649            }
650    
651            /**
652            * Returns the language of this d d m template.
653            *
654            * @return the language of this d d m template
655            */
656            public java.lang.String getLanguage() {
657                    return _ddmTemplate.getLanguage();
658            }
659    
660            /**
661            * Sets the language of this d d m template.
662            *
663            * @param language the language of this d d m template
664            */
665            public void setLanguage(java.lang.String language) {
666                    _ddmTemplate.setLanguage(language);
667            }
668    
669            /**
670            * Returns the script of this d d m template.
671            *
672            * @return the script of this d d m template
673            */
674            public java.lang.String getScript() {
675                    return _ddmTemplate.getScript();
676            }
677    
678            /**
679            * Sets the script of this d d m template.
680            *
681            * @param script the script of this d d m template
682            */
683            public void setScript(java.lang.String script) {
684                    _ddmTemplate.setScript(script);
685            }
686    
687            public boolean isNew() {
688                    return _ddmTemplate.isNew();
689            }
690    
691            public void setNew(boolean n) {
692                    _ddmTemplate.setNew(n);
693            }
694    
695            public boolean isCachedModel() {
696                    return _ddmTemplate.isCachedModel();
697            }
698    
699            public void setCachedModel(boolean cachedModel) {
700                    _ddmTemplate.setCachedModel(cachedModel);
701            }
702    
703            public boolean isEscapedModel() {
704                    return _ddmTemplate.isEscapedModel();
705            }
706    
707            public java.io.Serializable getPrimaryKeyObj() {
708                    return _ddmTemplate.getPrimaryKeyObj();
709            }
710    
711            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
712                    _ddmTemplate.setPrimaryKeyObj(primaryKeyObj);
713            }
714    
715            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
716                    return _ddmTemplate.getExpandoBridge();
717            }
718    
719            public void setExpandoBridgeAttributes(
720                    com.liferay.portal.service.ServiceContext serviceContext) {
721                    _ddmTemplate.setExpandoBridgeAttributes(serviceContext);
722            }
723    
724            public void prepareLocalizedFieldsForImport(
725                    java.util.Locale defaultImportLocale)
726                    throws com.liferay.portal.LocaleException {
727                    _ddmTemplate.prepareLocalizedFieldsForImport(defaultImportLocale);
728            }
729    
730            @Override
731            public java.lang.Object clone() {
732                    return new DDMTemplateWrapper((DDMTemplate)_ddmTemplate.clone());
733            }
734    
735            public int compareTo(
736                    com.liferay.portlet.dynamicdatamapping.model.DDMTemplate ddmTemplate) {
737                    return _ddmTemplate.compareTo(ddmTemplate);
738            }
739    
740            @Override
741            public int hashCode() {
742                    return _ddmTemplate.hashCode();
743            }
744    
745            public com.liferay.portal.model.CacheModel<com.liferay.portlet.dynamicdatamapping.model.DDMTemplate> toCacheModel() {
746                    return _ddmTemplate.toCacheModel();
747            }
748    
749            public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate toEscapedModel() {
750                    return new DDMTemplateWrapper(_ddmTemplate.toEscapedModel());
751            }
752    
753            public com.liferay.portlet.dynamicdatamapping.model.DDMTemplate toUnescapedModel() {
754                    return new DDMTemplateWrapper(_ddmTemplate.toUnescapedModel());
755            }
756    
757            @Override
758            public java.lang.String toString() {
759                    return _ddmTemplate.toString();
760            }
761    
762            public java.lang.String toXmlString() {
763                    return _ddmTemplate.toXmlString();
764            }
765    
766            public void persist()
767                    throws com.liferay.portal.kernel.exception.SystemException {
768                    _ddmTemplate.persist();
769            }
770    
771            public com.liferay.portlet.dynamicdatamapping.model.DDMStructure getStructure()
772                    throws com.liferay.portal.kernel.exception.PortalException,
773                            com.liferay.portal.kernel.exception.SystemException {
774                    return _ddmTemplate.getStructure();
775            }
776    
777            @Override
778            public boolean equals(Object obj) {
779                    if (this == obj) {
780                            return true;
781                    }
782    
783                    if (!(obj instanceof DDMTemplateWrapper)) {
784                            return false;
785                    }
786    
787                    DDMTemplateWrapper ddmTemplateWrapper = (DDMTemplateWrapper)obj;
788    
789                    if (Validator.equals(_ddmTemplate, ddmTemplateWrapper._ddmTemplate)) {
790                            return true;
791                    }
792    
793                    return false;
794            }
795    
796            /**
797             * @deprecated Renamed to {@link #getWrappedModel}
798             */
799            public DDMTemplate getWrappedDDMTemplate() {
800                    return _ddmTemplate;
801            }
802    
803            public DDMTemplate getWrappedModel() {
804                    return _ddmTemplate;
805            }
806    
807            public void resetOriginalValues() {
808                    _ddmTemplate.resetOriginalValues();
809            }
810    
811            private DDMTemplate _ddmTemplate;
812    }