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.util.Validator;
018    
019    import java.util.HashMap;
020    import java.util.Map;
021    
022    /**
023     * <p>
024     * This class is a wrapper for {@link LayoutPrototype}.
025     * </p>
026     *
027     * @author    Brian Wing Shun Chan
028     * @see       LayoutPrototype
029     * @generated
030     */
031    public class LayoutPrototypeWrapper implements LayoutPrototype,
032            ModelWrapper<LayoutPrototype> {
033            public LayoutPrototypeWrapper(LayoutPrototype layoutPrototype) {
034                    _layoutPrototype = layoutPrototype;
035            }
036    
037            public Class<?> getModelClass() {
038                    return LayoutPrototype.class;
039            }
040    
041            public String getModelClassName() {
042                    return LayoutPrototype.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("layoutPrototypeId", getLayoutPrototypeId());
050                    attributes.put("companyId", getCompanyId());
051                    attributes.put("name", getName());
052                    attributes.put("description", getDescription());
053                    attributes.put("settings", getSettings());
054                    attributes.put("active", getActive());
055    
056                    return attributes;
057            }
058    
059            public void setModelAttributes(Map<String, Object> attributes) {
060                    String uuid = (String)attributes.get("uuid");
061    
062                    if (uuid != null) {
063                            setUuid(uuid);
064                    }
065    
066                    Long layoutPrototypeId = (Long)attributes.get("layoutPrototypeId");
067    
068                    if (layoutPrototypeId != null) {
069                            setLayoutPrototypeId(layoutPrototypeId);
070                    }
071    
072                    Long companyId = (Long)attributes.get("companyId");
073    
074                    if (companyId != null) {
075                            setCompanyId(companyId);
076                    }
077    
078                    String name = (String)attributes.get("name");
079    
080                    if (name != null) {
081                            setName(name);
082                    }
083    
084                    String description = (String)attributes.get("description");
085    
086                    if (description != null) {
087                            setDescription(description);
088                    }
089    
090                    String settings = (String)attributes.get("settings");
091    
092                    if (settings != null) {
093                            setSettings(settings);
094                    }
095    
096                    Boolean active = (Boolean)attributes.get("active");
097    
098                    if (active != null) {
099                            setActive(active);
100                    }
101            }
102    
103            /**
104            * Returns the primary key of this layout prototype.
105            *
106            * @return the primary key of this layout prototype
107            */
108            public long getPrimaryKey() {
109                    return _layoutPrototype.getPrimaryKey();
110            }
111    
112            /**
113            * Sets the primary key of this layout prototype.
114            *
115            * @param primaryKey the primary key of this layout prototype
116            */
117            public void setPrimaryKey(long primaryKey) {
118                    _layoutPrototype.setPrimaryKey(primaryKey);
119            }
120    
121            /**
122            * Returns the uuid of this layout prototype.
123            *
124            * @return the uuid of this layout prototype
125            */
126            public java.lang.String getUuid() {
127                    return _layoutPrototype.getUuid();
128            }
129    
130            /**
131            * Sets the uuid of this layout prototype.
132            *
133            * @param uuid the uuid of this layout prototype
134            */
135            public void setUuid(java.lang.String uuid) {
136                    _layoutPrototype.setUuid(uuid);
137            }
138    
139            /**
140            * Returns the layout prototype ID of this layout prototype.
141            *
142            * @return the layout prototype ID of this layout prototype
143            */
144            public long getLayoutPrototypeId() {
145                    return _layoutPrototype.getLayoutPrototypeId();
146            }
147    
148            /**
149            * Sets the layout prototype ID of this layout prototype.
150            *
151            * @param layoutPrototypeId the layout prototype ID of this layout prototype
152            */
153            public void setLayoutPrototypeId(long layoutPrototypeId) {
154                    _layoutPrototype.setLayoutPrototypeId(layoutPrototypeId);
155            }
156    
157            /**
158            * Returns the company ID of this layout prototype.
159            *
160            * @return the company ID of this layout prototype
161            */
162            public long getCompanyId() {
163                    return _layoutPrototype.getCompanyId();
164            }
165    
166            /**
167            * Sets the company ID of this layout prototype.
168            *
169            * @param companyId the company ID of this layout prototype
170            */
171            public void setCompanyId(long companyId) {
172                    _layoutPrototype.setCompanyId(companyId);
173            }
174    
175            /**
176            * Returns the name of this layout prototype.
177            *
178            * @return the name of this layout prototype
179            */
180            public java.lang.String getName() {
181                    return _layoutPrototype.getName();
182            }
183    
184            /**
185            * Returns the localized name of this layout prototype in the language. Uses the default language if no localization exists for the requested language.
186            *
187            * @param locale the locale of the language
188            * @return the localized name of this layout prototype
189            */
190            public java.lang.String getName(java.util.Locale locale) {
191                    return _layoutPrototype.getName(locale);
192            }
193    
194            /**
195            * Returns the localized name of this layout prototype in the language, optionally using the default language if no localization exists for the requested language.
196            *
197            * @param locale the local of the language
198            * @param useDefault whether to use the default language if no localization exists for the requested language
199            * @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.
200            */
201            public java.lang.String getName(java.util.Locale locale, boolean useDefault) {
202                    return _layoutPrototype.getName(locale, useDefault);
203            }
204    
205            /**
206            * Returns the localized name of this layout prototype in the language. Uses the default language if no localization exists for the requested language.
207            *
208            * @param languageId the ID of the language
209            * @return the localized name of this layout prototype
210            */
211            public java.lang.String getName(java.lang.String languageId) {
212                    return _layoutPrototype.getName(languageId);
213            }
214    
215            /**
216            * Returns the localized name of this layout prototype in the language, optionally using the default language if no localization exists for the requested language.
217            *
218            * @param languageId the ID of the language
219            * @param useDefault whether to use the default language if no localization exists for the requested language
220            * @return the localized name of this layout prototype
221            */
222            public java.lang.String getName(java.lang.String languageId,
223                    boolean useDefault) {
224                    return _layoutPrototype.getName(languageId, useDefault);
225            }
226    
227            public java.lang.String getNameCurrentLanguageId() {
228                    return _layoutPrototype.getNameCurrentLanguageId();
229            }
230    
231            public java.lang.String getNameCurrentValue() {
232                    return _layoutPrototype.getNameCurrentValue();
233            }
234    
235            /**
236            * Returns a map of the locales and localized names of this layout prototype.
237            *
238            * @return the locales and localized names of this layout prototype
239            */
240            public java.util.Map<java.util.Locale, java.lang.String> getNameMap() {
241                    return _layoutPrototype.getNameMap();
242            }
243    
244            /**
245            * Sets the name of this layout prototype.
246            *
247            * @param name the name of this layout prototype
248            */
249            public void setName(java.lang.String name) {
250                    _layoutPrototype.setName(name);
251            }
252    
253            /**
254            * Sets the localized name of this layout prototype in the language.
255            *
256            * @param name the localized name of this layout prototype
257            * @param locale the locale of the language
258            */
259            public void setName(java.lang.String name, java.util.Locale locale) {
260                    _layoutPrototype.setName(name, locale);
261            }
262    
263            /**
264            * Sets the localized name of this layout prototype in the language, and sets the default locale.
265            *
266            * @param name the localized name of this layout prototype
267            * @param locale the locale of the language
268            * @param defaultLocale the default locale
269            */
270            public void setName(java.lang.String name, java.util.Locale locale,
271                    java.util.Locale defaultLocale) {
272                    _layoutPrototype.setName(name, locale, defaultLocale);
273            }
274    
275            public void setNameCurrentLanguageId(java.lang.String languageId) {
276                    _layoutPrototype.setNameCurrentLanguageId(languageId);
277            }
278    
279            /**
280            * Sets the localized names of this layout prototype from the map of locales and localized names.
281            *
282            * @param nameMap the locales and localized names of this layout prototype
283            */
284            public void setNameMap(
285                    java.util.Map<java.util.Locale, java.lang.String> nameMap) {
286                    _layoutPrototype.setNameMap(nameMap);
287            }
288    
289            /**
290            * Sets the localized names of this layout prototype from the map of locales and localized names, and sets the default locale.
291            *
292            * @param nameMap the locales and localized names of this layout prototype
293            * @param defaultLocale the default locale
294            */
295            public void setNameMap(
296                    java.util.Map<java.util.Locale, java.lang.String> nameMap,
297                    java.util.Locale defaultLocale) {
298                    _layoutPrototype.setNameMap(nameMap, defaultLocale);
299            }
300    
301            /**
302            * Returns the description of this layout prototype.
303            *
304            * @return the description of this layout prototype
305            */
306            public java.lang.String getDescription() {
307                    return _layoutPrototype.getDescription();
308            }
309    
310            /**
311            * Sets the description of this layout prototype.
312            *
313            * @param description the description of this layout prototype
314            */
315            public void setDescription(java.lang.String description) {
316                    _layoutPrototype.setDescription(description);
317            }
318    
319            /**
320            * Returns the settings of this layout prototype.
321            *
322            * @return the settings of this layout prototype
323            */
324            public java.lang.String getSettings() {
325                    return _layoutPrototype.getSettings();
326            }
327    
328            /**
329            * Sets the settings of this layout prototype.
330            *
331            * @param settings the settings of this layout prototype
332            */
333            public void setSettings(java.lang.String settings) {
334                    _layoutPrototype.setSettings(settings);
335            }
336    
337            /**
338            * Returns the active of this layout prototype.
339            *
340            * @return the active of this layout prototype
341            */
342            public boolean getActive() {
343                    return _layoutPrototype.getActive();
344            }
345    
346            /**
347            * Returns <code>true</code> if this layout prototype is active.
348            *
349            * @return <code>true</code> if this layout prototype is active; <code>false</code> otherwise
350            */
351            public boolean isActive() {
352                    return _layoutPrototype.isActive();
353            }
354    
355            /**
356            * Sets whether this layout prototype is active.
357            *
358            * @param active the active of this layout prototype
359            */
360            public void setActive(boolean active) {
361                    _layoutPrototype.setActive(active);
362            }
363    
364            public boolean isNew() {
365                    return _layoutPrototype.isNew();
366            }
367    
368            public void setNew(boolean n) {
369                    _layoutPrototype.setNew(n);
370            }
371    
372            public boolean isCachedModel() {
373                    return _layoutPrototype.isCachedModel();
374            }
375    
376            public void setCachedModel(boolean cachedModel) {
377                    _layoutPrototype.setCachedModel(cachedModel);
378            }
379    
380            public boolean isEscapedModel() {
381                    return _layoutPrototype.isEscapedModel();
382            }
383    
384            public java.io.Serializable getPrimaryKeyObj() {
385                    return _layoutPrototype.getPrimaryKeyObj();
386            }
387    
388            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
389                    _layoutPrototype.setPrimaryKeyObj(primaryKeyObj);
390            }
391    
392            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
393                    return _layoutPrototype.getExpandoBridge();
394            }
395    
396            public void setExpandoBridgeAttributes(
397                    com.liferay.portal.service.ServiceContext serviceContext) {
398                    _layoutPrototype.setExpandoBridgeAttributes(serviceContext);
399            }
400    
401            public void prepareLocalizedFieldsForImport(
402                    java.util.Locale defaultImportLocale)
403                    throws com.liferay.portal.LocaleException {
404                    _layoutPrototype.prepareLocalizedFieldsForImport(defaultImportLocale);
405            }
406    
407            @Override
408            public java.lang.Object clone() {
409                    return new LayoutPrototypeWrapper((LayoutPrototype)_layoutPrototype.clone());
410            }
411    
412            public int compareTo(
413                    com.liferay.portal.model.LayoutPrototype layoutPrototype) {
414                    return _layoutPrototype.compareTo(layoutPrototype);
415            }
416    
417            @Override
418            public int hashCode() {
419                    return _layoutPrototype.hashCode();
420            }
421    
422            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.LayoutPrototype> toCacheModel() {
423                    return _layoutPrototype.toCacheModel();
424            }
425    
426            public com.liferay.portal.model.LayoutPrototype toEscapedModel() {
427                    return new LayoutPrototypeWrapper(_layoutPrototype.toEscapedModel());
428            }
429    
430            public com.liferay.portal.model.LayoutPrototype toUnescapedModel() {
431                    return new LayoutPrototypeWrapper(_layoutPrototype.toUnescapedModel());
432            }
433    
434            @Override
435            public java.lang.String toString() {
436                    return _layoutPrototype.toString();
437            }
438    
439            public java.lang.String toXmlString() {
440                    return _layoutPrototype.toXmlString();
441            }
442    
443            public void persist()
444                    throws com.liferay.portal.kernel.exception.SystemException {
445                    _layoutPrototype.persist();
446            }
447    
448            public com.liferay.portal.model.Group getGroup()
449                    throws com.liferay.portal.kernel.exception.PortalException,
450                            com.liferay.portal.kernel.exception.SystemException {
451                    return _layoutPrototype.getGroup();
452            }
453    
454            public long getGroupId()
455                    throws com.liferay.portal.kernel.exception.PortalException,
456                            com.liferay.portal.kernel.exception.SystemException {
457                    return _layoutPrototype.getGroupId();
458            }
459    
460            public com.liferay.portal.model.Layout getLayout()
461                    throws com.liferay.portal.kernel.exception.PortalException,
462                            com.liferay.portal.kernel.exception.SystemException {
463                    return _layoutPrototype.getLayout();
464            }
465    
466            @Override
467            public boolean equals(Object obj) {
468                    if (this == obj) {
469                            return true;
470                    }
471    
472                    if (!(obj instanceof LayoutPrototypeWrapper)) {
473                            return false;
474                    }
475    
476                    LayoutPrototypeWrapper layoutPrototypeWrapper = (LayoutPrototypeWrapper)obj;
477    
478                    if (Validator.equals(_layoutPrototype,
479                                            layoutPrototypeWrapper._layoutPrototype)) {
480                            return true;
481                    }
482    
483                    return false;
484            }
485    
486            /**
487             * @deprecated Renamed to {@link #getWrappedModel}
488             */
489            public LayoutPrototype getWrappedLayoutPrototype() {
490                    return _layoutPrototype;
491            }
492    
493            public LayoutPrototype getWrappedModel() {
494                    return _layoutPrototype;
495            }
496    
497            public void resetOriginalValues() {
498                    _layoutPrototype.resetOriginalValues();
499            }
500    
501            private LayoutPrototype _layoutPrototype;
502    }