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