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