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