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.impl;
016    
017    import com.liferay.portal.LocaleException;
018    import com.liferay.portal.kernel.bean.AutoEscapeBeanHandler;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.json.JSON;
021    import com.liferay.portal.kernel.language.LanguageUtil;
022    import com.liferay.portal.kernel.util.GetterUtil;
023    import com.liferay.portal.kernel.util.LocaleUtil;
024    import com.liferay.portal.kernel.util.LocalizationUtil;
025    import com.liferay.portal.kernel.util.ProxyUtil;
026    import com.liferay.portal.kernel.util.StringBundler;
027    import com.liferay.portal.kernel.util.StringPool;
028    import com.liferay.portal.kernel.util.Validator;
029    import com.liferay.portal.model.CacheModel;
030    import com.liferay.portal.model.impl.BaseModelImpl;
031    import com.liferay.portal.service.ServiceContext;
032    import com.liferay.portal.util.PortalUtil;
033    
034    import com.liferay.portlet.expando.model.ExpandoBridge;
035    import com.liferay.portlet.expando.util.ExpandoBridgeFactoryUtil;
036    import com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup;
037    import com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupModel;
038    import com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupSoap;
039    
040    import java.io.Serializable;
041    
042    import java.sql.Types;
043    
044    import java.util.ArrayList;
045    import java.util.Date;
046    import java.util.HashMap;
047    import java.util.List;
048    import java.util.Locale;
049    import java.util.Map;
050    
051    /**
052     * The base model implementation for the MDRRuleGroup service. Represents a row in the "MDRRuleGroup" database table, with each column mapped to a property of this class.
053     *
054     * <p>
055     * This implementation and its corresponding interface {@link com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupModel} exist only as a container for the default property accessors generated by ServiceBuilder. Helper methods and all application logic should be put in {@link MDRRuleGroupImpl}.
056     * </p>
057     *
058     * @author Edward C. Han
059     * @see MDRRuleGroupImpl
060     * @see com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup
061     * @see com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupModel
062     * @generated
063     */
064    @JSON(strict = true)
065    public class MDRRuleGroupModelImpl extends BaseModelImpl<MDRRuleGroup>
066            implements MDRRuleGroupModel {
067            /*
068             * NOTE FOR DEVELOPERS:
069             *
070             * Never modify or reference this class directly. All methods that expect a m d r rule group model instance should use the {@link com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup} interface instead.
071             */
072            public static final String TABLE_NAME = "MDRRuleGroup";
073            public static final Object[][] TABLE_COLUMNS = {
074                            { "uuid_", Types.VARCHAR },
075                            { "ruleGroupId", Types.BIGINT },
076                            { "groupId", Types.BIGINT },
077                            { "companyId", Types.BIGINT },
078                            { "userId", Types.BIGINT },
079                            { "userName", Types.VARCHAR },
080                            { "createDate", Types.TIMESTAMP },
081                            { "modifiedDate", Types.TIMESTAMP },
082                            { "name", Types.VARCHAR },
083                            { "description", Types.VARCHAR }
084                    };
085            public static final String TABLE_SQL_CREATE = "create table MDRRuleGroup (uuid_ VARCHAR(75) null,ruleGroupId LONG not null primary key,groupId LONG,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,name STRING null,description STRING null)";
086            public static final String TABLE_SQL_DROP = "drop table MDRRuleGroup";
087            public static final String DATA_SOURCE = "liferayDataSource";
088            public static final String SESSION_FACTORY = "liferaySessionFactory";
089            public static final String TX_MANAGER = "liferayTransactionManager";
090            public static final boolean ENTITY_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
091                                    "value.object.entity.cache.enabled.com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup"),
092                            true);
093            public static final boolean FINDER_CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
094                                    "value.object.finder.cache.enabled.com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup"),
095                            true);
096            public static final boolean COLUMN_BITMASK_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
097                                    "value.object.column.bitmask.enabled.com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup"),
098                            true);
099            public static long GROUPID_COLUMN_BITMASK = 1L;
100            public static long UUID_COLUMN_BITMASK = 2L;
101    
102            /**
103             * Converts the soap model instance into a normal model instance.
104             *
105             * @param soapModel the soap model instance to convert
106             * @return the normal model instance
107             */
108            public static MDRRuleGroup toModel(MDRRuleGroupSoap soapModel) {
109                    if (soapModel == null) {
110                            return null;
111                    }
112    
113                    MDRRuleGroup model = new MDRRuleGroupImpl();
114    
115                    model.setUuid(soapModel.getUuid());
116                    model.setRuleGroupId(soapModel.getRuleGroupId());
117                    model.setGroupId(soapModel.getGroupId());
118                    model.setCompanyId(soapModel.getCompanyId());
119                    model.setUserId(soapModel.getUserId());
120                    model.setUserName(soapModel.getUserName());
121                    model.setCreateDate(soapModel.getCreateDate());
122                    model.setModifiedDate(soapModel.getModifiedDate());
123                    model.setName(soapModel.getName());
124                    model.setDescription(soapModel.getDescription());
125    
126                    return model;
127            }
128    
129            /**
130             * Converts the soap model instances into normal model instances.
131             *
132             * @param soapModels the soap model instances to convert
133             * @return the normal model instances
134             */
135            public static List<MDRRuleGroup> toModels(MDRRuleGroupSoap[] soapModels) {
136                    if (soapModels == null) {
137                            return null;
138                    }
139    
140                    List<MDRRuleGroup> models = new ArrayList<MDRRuleGroup>(soapModels.length);
141    
142                    for (MDRRuleGroupSoap soapModel : soapModels) {
143                            models.add(toModel(soapModel));
144                    }
145    
146                    return models;
147            }
148    
149            public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
150                                    "lock.expiration.time.com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup"));
151    
152            public MDRRuleGroupModelImpl() {
153            }
154    
155            public long getPrimaryKey() {
156                    return _ruleGroupId;
157            }
158    
159            public void setPrimaryKey(long primaryKey) {
160                    setRuleGroupId(primaryKey);
161            }
162    
163            public Serializable getPrimaryKeyObj() {
164                    return new Long(_ruleGroupId);
165            }
166    
167            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
168                    setPrimaryKey(((Long)primaryKeyObj).longValue());
169            }
170    
171            public Class<?> getModelClass() {
172                    return MDRRuleGroup.class;
173            }
174    
175            public String getModelClassName() {
176                    return MDRRuleGroup.class.getName();
177            }
178    
179            @Override
180            public Map<String, Object> getModelAttributes() {
181                    Map<String, Object> attributes = new HashMap<String, Object>();
182    
183                    attributes.put("uuid", getUuid());
184                    attributes.put("ruleGroupId", getRuleGroupId());
185                    attributes.put("groupId", getGroupId());
186                    attributes.put("companyId", getCompanyId());
187                    attributes.put("userId", getUserId());
188                    attributes.put("userName", getUserName());
189                    attributes.put("createDate", getCreateDate());
190                    attributes.put("modifiedDate", getModifiedDate());
191                    attributes.put("name", getName());
192                    attributes.put("description", getDescription());
193    
194                    return attributes;
195            }
196    
197            @Override
198            public void setModelAttributes(Map<String, Object> attributes) {
199                    String uuid = (String)attributes.get("uuid");
200    
201                    if (uuid != null) {
202                            setUuid(uuid);
203                    }
204    
205                    Long ruleGroupId = (Long)attributes.get("ruleGroupId");
206    
207                    if (ruleGroupId != null) {
208                            setRuleGroupId(ruleGroupId);
209                    }
210    
211                    Long groupId = (Long)attributes.get("groupId");
212    
213                    if (groupId != null) {
214                            setGroupId(groupId);
215                    }
216    
217                    Long companyId = (Long)attributes.get("companyId");
218    
219                    if (companyId != null) {
220                            setCompanyId(companyId);
221                    }
222    
223                    Long userId = (Long)attributes.get("userId");
224    
225                    if (userId != null) {
226                            setUserId(userId);
227                    }
228    
229                    String userName = (String)attributes.get("userName");
230    
231                    if (userName != null) {
232                            setUserName(userName);
233                    }
234    
235                    Date createDate = (Date)attributes.get("createDate");
236    
237                    if (createDate != null) {
238                            setCreateDate(createDate);
239                    }
240    
241                    Date modifiedDate = (Date)attributes.get("modifiedDate");
242    
243                    if (modifiedDate != null) {
244                            setModifiedDate(modifiedDate);
245                    }
246    
247                    String name = (String)attributes.get("name");
248    
249                    if (name != null) {
250                            setName(name);
251                    }
252    
253                    String description = (String)attributes.get("description");
254    
255                    if (description != null) {
256                            setDescription(description);
257                    }
258            }
259    
260            @JSON
261            public String getUuid() {
262                    if (_uuid == null) {
263                            return StringPool.BLANK;
264                    }
265                    else {
266                            return _uuid;
267                    }
268            }
269    
270            public void setUuid(String uuid) {
271                    if (_originalUuid == null) {
272                            _originalUuid = _uuid;
273                    }
274    
275                    _uuid = uuid;
276            }
277    
278            public String getOriginalUuid() {
279                    return GetterUtil.getString(_originalUuid);
280            }
281    
282            @JSON
283            public long getRuleGroupId() {
284                    return _ruleGroupId;
285            }
286    
287            public void setRuleGroupId(long ruleGroupId) {
288                    _ruleGroupId = ruleGroupId;
289            }
290    
291            @JSON
292            public long getGroupId() {
293                    return _groupId;
294            }
295    
296            public void setGroupId(long groupId) {
297                    _columnBitmask |= GROUPID_COLUMN_BITMASK;
298    
299                    if (!_setOriginalGroupId) {
300                            _setOriginalGroupId = true;
301    
302                            _originalGroupId = _groupId;
303                    }
304    
305                    _groupId = groupId;
306            }
307    
308            public long getOriginalGroupId() {
309                    return _originalGroupId;
310            }
311    
312            @JSON
313            public long getCompanyId() {
314                    return _companyId;
315            }
316    
317            public void setCompanyId(long companyId) {
318                    _companyId = companyId;
319            }
320    
321            @JSON
322            public long getUserId() {
323                    return _userId;
324            }
325    
326            public void setUserId(long userId) {
327                    _userId = userId;
328            }
329    
330            public String getUserUuid() throws SystemException {
331                    return PortalUtil.getUserValue(getUserId(), "uuid", _userUuid);
332            }
333    
334            public void setUserUuid(String userUuid) {
335                    _userUuid = userUuid;
336            }
337    
338            @JSON
339            public String getUserName() {
340                    if (_userName == null) {
341                            return StringPool.BLANK;
342                    }
343                    else {
344                            return _userName;
345                    }
346            }
347    
348            public void setUserName(String userName) {
349                    _userName = userName;
350            }
351    
352            @JSON
353            public Date getCreateDate() {
354                    return _createDate;
355            }
356    
357            public void setCreateDate(Date createDate) {
358                    _createDate = createDate;
359            }
360    
361            @JSON
362            public Date getModifiedDate() {
363                    return _modifiedDate;
364            }
365    
366            public void setModifiedDate(Date modifiedDate) {
367                    _modifiedDate = modifiedDate;
368            }
369    
370            @JSON
371            public String getName() {
372                    if (_name == null) {
373                            return StringPool.BLANK;
374                    }
375                    else {
376                            return _name;
377                    }
378            }
379    
380            public String getName(Locale locale) {
381                    String languageId = LocaleUtil.toLanguageId(locale);
382    
383                    return getName(languageId);
384            }
385    
386            public String getName(Locale locale, boolean useDefault) {
387                    String languageId = LocaleUtil.toLanguageId(locale);
388    
389                    return getName(languageId, useDefault);
390            }
391    
392            public String getName(String languageId) {
393                    return LocalizationUtil.getLocalization(getName(), languageId);
394            }
395    
396            public String getName(String languageId, boolean useDefault) {
397                    return LocalizationUtil.getLocalization(getName(), languageId,
398                            useDefault);
399            }
400    
401            public String getNameCurrentLanguageId() {
402                    return _nameCurrentLanguageId;
403            }
404    
405            @JSON
406            public String getNameCurrentValue() {
407                    Locale locale = getLocale(_nameCurrentLanguageId);
408    
409                    return getName(locale);
410            }
411    
412            public Map<Locale, String> getNameMap() {
413                    return LocalizationUtil.getLocalizationMap(getName());
414            }
415    
416            public void setName(String name) {
417                    _name = name;
418            }
419    
420            public void setName(String name, Locale locale) {
421                    setName(name, locale, LocaleUtil.getDefault());
422            }
423    
424            public void setName(String name, Locale locale, Locale defaultLocale) {
425                    String languageId = LocaleUtil.toLanguageId(locale);
426                    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
427    
428                    if (Validator.isNotNull(name)) {
429                            setName(LocalizationUtil.updateLocalization(getName(), "Name",
430                                            name, languageId, defaultLanguageId));
431                    }
432                    else {
433                            setName(LocalizationUtil.removeLocalization(getName(), "Name",
434                                            languageId));
435                    }
436            }
437    
438            public void setNameCurrentLanguageId(String languageId) {
439                    _nameCurrentLanguageId = languageId;
440            }
441    
442            public void setNameMap(Map<Locale, String> nameMap) {
443                    setNameMap(nameMap, LocaleUtil.getDefault());
444            }
445    
446            public void setNameMap(Map<Locale, String> nameMap, Locale defaultLocale) {
447                    if (nameMap == null) {
448                            return;
449                    }
450    
451                    Locale[] locales = LanguageUtil.getAvailableLocales();
452    
453                    for (Locale locale : locales) {
454                            String name = nameMap.get(locale);
455    
456                            setName(name, locale, defaultLocale);
457                    }
458            }
459    
460            @JSON
461            public String getDescription() {
462                    if (_description == null) {
463                            return StringPool.BLANK;
464                    }
465                    else {
466                            return _description;
467                    }
468            }
469    
470            public String getDescription(Locale locale) {
471                    String languageId = LocaleUtil.toLanguageId(locale);
472    
473                    return getDescription(languageId);
474            }
475    
476            public String getDescription(Locale locale, boolean useDefault) {
477                    String languageId = LocaleUtil.toLanguageId(locale);
478    
479                    return getDescription(languageId, useDefault);
480            }
481    
482            public String getDescription(String languageId) {
483                    return LocalizationUtil.getLocalization(getDescription(), languageId);
484            }
485    
486            public String getDescription(String languageId, boolean useDefault) {
487                    return LocalizationUtil.getLocalization(getDescription(), languageId,
488                            useDefault);
489            }
490    
491            public String getDescriptionCurrentLanguageId() {
492                    return _descriptionCurrentLanguageId;
493            }
494    
495            @JSON
496            public String getDescriptionCurrentValue() {
497                    Locale locale = getLocale(_descriptionCurrentLanguageId);
498    
499                    return getDescription(locale);
500            }
501    
502            public Map<Locale, String> getDescriptionMap() {
503                    return LocalizationUtil.getLocalizationMap(getDescription());
504            }
505    
506            public void setDescription(String description) {
507                    _description = description;
508            }
509    
510            public void setDescription(String description, Locale locale) {
511                    setDescription(description, locale, LocaleUtil.getDefault());
512            }
513    
514            public void setDescription(String description, Locale locale,
515                    Locale defaultLocale) {
516                    String languageId = LocaleUtil.toLanguageId(locale);
517                    String defaultLanguageId = LocaleUtil.toLanguageId(defaultLocale);
518    
519                    if (Validator.isNotNull(description)) {
520                            setDescription(LocalizationUtil.updateLocalization(
521                                            getDescription(), "Description", description, languageId,
522                                            defaultLanguageId));
523                    }
524                    else {
525                            setDescription(LocalizationUtil.removeLocalization(
526                                            getDescription(), "Description", languageId));
527                    }
528            }
529    
530            public void setDescriptionCurrentLanguageId(String languageId) {
531                    _descriptionCurrentLanguageId = languageId;
532            }
533    
534            public void setDescriptionMap(Map<Locale, String> descriptionMap) {
535                    setDescriptionMap(descriptionMap, LocaleUtil.getDefault());
536            }
537    
538            public void setDescriptionMap(Map<Locale, String> descriptionMap,
539                    Locale defaultLocale) {
540                    if (descriptionMap == null) {
541                            return;
542                    }
543    
544                    Locale[] locales = LanguageUtil.getAvailableLocales();
545    
546                    for (Locale locale : locales) {
547                            String description = descriptionMap.get(locale);
548    
549                            setDescription(description, locale, defaultLocale);
550                    }
551            }
552    
553            public long getColumnBitmask() {
554                    return _columnBitmask;
555            }
556    
557            @Override
558            public ExpandoBridge getExpandoBridge() {
559                    return ExpandoBridgeFactoryUtil.getExpandoBridge(getCompanyId(),
560                            MDRRuleGroup.class.getName(), getPrimaryKey());
561            }
562    
563            @Override
564            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
565                    ExpandoBridge expandoBridge = getExpandoBridge();
566    
567                    expandoBridge.setAttributes(serviceContext);
568            }
569    
570            @SuppressWarnings("unused")
571            public void prepareLocalizedFieldsForImport(Locale defaultImportLocale)
572                    throws LocaleException {
573                    setName(getName(defaultImportLocale), defaultImportLocale,
574                            defaultImportLocale);
575                    setDescription(getDescription(defaultImportLocale),
576                            defaultImportLocale, defaultImportLocale);
577            }
578    
579            @Override
580            public MDRRuleGroup toEscapedModel() {
581                    if (_escapedModel == null) {
582                            _escapedModel = (MDRRuleGroup)ProxyUtil.newProxyInstance(_classLoader,
583                                            _escapedModelInterfaces, new AutoEscapeBeanHandler(this));
584                    }
585    
586                    return _escapedModel;
587            }
588    
589            public MDRRuleGroup toUnescapedModel() {
590                    return (MDRRuleGroup)this;
591            }
592    
593            @Override
594            public Object clone() {
595                    MDRRuleGroupImpl mdrRuleGroupImpl = new MDRRuleGroupImpl();
596    
597                    mdrRuleGroupImpl.setUuid(getUuid());
598                    mdrRuleGroupImpl.setRuleGroupId(getRuleGroupId());
599                    mdrRuleGroupImpl.setGroupId(getGroupId());
600                    mdrRuleGroupImpl.setCompanyId(getCompanyId());
601                    mdrRuleGroupImpl.setUserId(getUserId());
602                    mdrRuleGroupImpl.setUserName(getUserName());
603                    mdrRuleGroupImpl.setCreateDate(getCreateDate());
604                    mdrRuleGroupImpl.setModifiedDate(getModifiedDate());
605                    mdrRuleGroupImpl.setName(getName());
606                    mdrRuleGroupImpl.setDescription(getDescription());
607    
608                    mdrRuleGroupImpl.resetOriginalValues();
609    
610                    return mdrRuleGroupImpl;
611            }
612    
613            public int compareTo(MDRRuleGroup mdrRuleGroup) {
614                    long primaryKey = mdrRuleGroup.getPrimaryKey();
615    
616                    if (getPrimaryKey() < primaryKey) {
617                            return -1;
618                    }
619                    else if (getPrimaryKey() > primaryKey) {
620                            return 1;
621                    }
622                    else {
623                            return 0;
624                    }
625            }
626    
627            @Override
628            public boolean equals(Object obj) {
629                    if (this == obj) {
630                            return true;
631                    }
632    
633                    if (!(obj instanceof MDRRuleGroup)) {
634                            return false;
635                    }
636    
637                    MDRRuleGroup mdrRuleGroup = (MDRRuleGroup)obj;
638    
639                    long primaryKey = mdrRuleGroup.getPrimaryKey();
640    
641                    if (getPrimaryKey() == primaryKey) {
642                            return true;
643                    }
644                    else {
645                            return false;
646                    }
647            }
648    
649            @Override
650            public int hashCode() {
651                    return (int)getPrimaryKey();
652            }
653    
654            @Override
655            public void resetOriginalValues() {
656                    MDRRuleGroupModelImpl mdrRuleGroupModelImpl = this;
657    
658                    mdrRuleGroupModelImpl._originalUuid = mdrRuleGroupModelImpl._uuid;
659    
660                    mdrRuleGroupModelImpl._originalGroupId = mdrRuleGroupModelImpl._groupId;
661    
662                    mdrRuleGroupModelImpl._setOriginalGroupId = false;
663    
664                    mdrRuleGroupModelImpl._columnBitmask = 0;
665            }
666    
667            @Override
668            public CacheModel<MDRRuleGroup> toCacheModel() {
669                    MDRRuleGroupCacheModel mdrRuleGroupCacheModel = new MDRRuleGroupCacheModel();
670    
671                    mdrRuleGroupCacheModel.uuid = getUuid();
672    
673                    String uuid = mdrRuleGroupCacheModel.uuid;
674    
675                    if ((uuid != null) && (uuid.length() == 0)) {
676                            mdrRuleGroupCacheModel.uuid = null;
677                    }
678    
679                    mdrRuleGroupCacheModel.ruleGroupId = getRuleGroupId();
680    
681                    mdrRuleGroupCacheModel.groupId = getGroupId();
682    
683                    mdrRuleGroupCacheModel.companyId = getCompanyId();
684    
685                    mdrRuleGroupCacheModel.userId = getUserId();
686    
687                    mdrRuleGroupCacheModel.userName = getUserName();
688    
689                    String userName = mdrRuleGroupCacheModel.userName;
690    
691                    if ((userName != null) && (userName.length() == 0)) {
692                            mdrRuleGroupCacheModel.userName = null;
693                    }
694    
695                    Date createDate = getCreateDate();
696    
697                    if (createDate != null) {
698                            mdrRuleGroupCacheModel.createDate = createDate.getTime();
699                    }
700                    else {
701                            mdrRuleGroupCacheModel.createDate = Long.MIN_VALUE;
702                    }
703    
704                    Date modifiedDate = getModifiedDate();
705    
706                    if (modifiedDate != null) {
707                            mdrRuleGroupCacheModel.modifiedDate = modifiedDate.getTime();
708                    }
709                    else {
710                            mdrRuleGroupCacheModel.modifiedDate = Long.MIN_VALUE;
711                    }
712    
713                    mdrRuleGroupCacheModel.name = getName();
714    
715                    String name = mdrRuleGroupCacheModel.name;
716    
717                    if ((name != null) && (name.length() == 0)) {
718                            mdrRuleGroupCacheModel.name = null;
719                    }
720    
721                    mdrRuleGroupCacheModel.description = getDescription();
722    
723                    String description = mdrRuleGroupCacheModel.description;
724    
725                    if ((description != null) && (description.length() == 0)) {
726                            mdrRuleGroupCacheModel.description = null;
727                    }
728    
729                    return mdrRuleGroupCacheModel;
730            }
731    
732            @Override
733            public String toString() {
734                    StringBundler sb = new StringBundler(21);
735    
736                    sb.append("{uuid=");
737                    sb.append(getUuid());
738                    sb.append(", ruleGroupId=");
739                    sb.append(getRuleGroupId());
740                    sb.append(", groupId=");
741                    sb.append(getGroupId());
742                    sb.append(", companyId=");
743                    sb.append(getCompanyId());
744                    sb.append(", userId=");
745                    sb.append(getUserId());
746                    sb.append(", userName=");
747                    sb.append(getUserName());
748                    sb.append(", createDate=");
749                    sb.append(getCreateDate());
750                    sb.append(", modifiedDate=");
751                    sb.append(getModifiedDate());
752                    sb.append(", name=");
753                    sb.append(getName());
754                    sb.append(", description=");
755                    sb.append(getDescription());
756                    sb.append("}");
757    
758                    return sb.toString();
759            }
760    
761            public String toXmlString() {
762                    StringBundler sb = new StringBundler(34);
763    
764                    sb.append("<model><model-name>");
765                    sb.append("com.liferay.portlet.mobiledevicerules.model.MDRRuleGroup");
766                    sb.append("</model-name>");
767    
768                    sb.append(
769                            "<column><column-name>uuid</column-name><column-value><![CDATA[");
770                    sb.append(getUuid());
771                    sb.append("]]></column-value></column>");
772                    sb.append(
773                            "<column><column-name>ruleGroupId</column-name><column-value><![CDATA[");
774                    sb.append(getRuleGroupId());
775                    sb.append("]]></column-value></column>");
776                    sb.append(
777                            "<column><column-name>groupId</column-name><column-value><![CDATA[");
778                    sb.append(getGroupId());
779                    sb.append("]]></column-value></column>");
780                    sb.append(
781                            "<column><column-name>companyId</column-name><column-value><![CDATA[");
782                    sb.append(getCompanyId());
783                    sb.append("]]></column-value></column>");
784                    sb.append(
785                            "<column><column-name>userId</column-name><column-value><![CDATA[");
786                    sb.append(getUserId());
787                    sb.append("]]></column-value></column>");
788                    sb.append(
789                            "<column><column-name>userName</column-name><column-value><![CDATA[");
790                    sb.append(getUserName());
791                    sb.append("]]></column-value></column>");
792                    sb.append(
793                            "<column><column-name>createDate</column-name><column-value><![CDATA[");
794                    sb.append(getCreateDate());
795                    sb.append("]]></column-value></column>");
796                    sb.append(
797                            "<column><column-name>modifiedDate</column-name><column-value><![CDATA[");
798                    sb.append(getModifiedDate());
799                    sb.append("]]></column-value></column>");
800                    sb.append(
801                            "<column><column-name>name</column-name><column-value><![CDATA[");
802                    sb.append(getName());
803                    sb.append("]]></column-value></column>");
804                    sb.append(
805                            "<column><column-name>description</column-name><column-value><![CDATA[");
806                    sb.append(getDescription());
807                    sb.append("]]></column-value></column>");
808    
809                    sb.append("</model>");
810    
811                    return sb.toString();
812            }
813    
814            private static ClassLoader _classLoader = MDRRuleGroup.class.getClassLoader();
815            private static Class<?>[] _escapedModelInterfaces = new Class[] {
816                            MDRRuleGroup.class
817                    };
818            private String _uuid;
819            private String _originalUuid;
820            private long _ruleGroupId;
821            private long _groupId;
822            private long _originalGroupId;
823            private boolean _setOriginalGroupId;
824            private long _companyId;
825            private long _userId;
826            private String _userUuid;
827            private String _userName;
828            private Date _createDate;
829            private Date _modifiedDate;
830            private String _name;
831            private String _nameCurrentLanguageId;
832            private String _description;
833            private String _descriptionCurrentLanguageId;
834            private long _columnBitmask;
835            private MDRRuleGroup _escapedModel;
836    }