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.impl;
016    
017    import com.liferay.portal.kernel.util.StringBundler;
018    import com.liferay.portal.kernel.util.StringPool;
019    import com.liferay.portal.model.CacheModel;
020    import com.liferay.portal.model.Group;
021    
022    import java.io.Externalizable;
023    import java.io.IOException;
024    import java.io.ObjectInput;
025    import java.io.ObjectOutput;
026    
027    /**
028     * The cache model class for representing Group in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see Group
032     * @generated
033     */
034    public class GroupCacheModel implements CacheModel<Group>, Externalizable {
035            @Override
036            public String toString() {
037                    StringBundler sb = new StringBundler(39);
038    
039                    sb.append("{uuid=");
040                    sb.append(uuid);
041                    sb.append(", groupId=");
042                    sb.append(groupId);
043                    sb.append(", companyId=");
044                    sb.append(companyId);
045                    sb.append(", creatorUserId=");
046                    sb.append(creatorUserId);
047                    sb.append(", classNameId=");
048                    sb.append(classNameId);
049                    sb.append(", classPK=");
050                    sb.append(classPK);
051                    sb.append(", parentGroupId=");
052                    sb.append(parentGroupId);
053                    sb.append(", liveGroupId=");
054                    sb.append(liveGroupId);
055                    sb.append(", treePath=");
056                    sb.append(treePath);
057                    sb.append(", name=");
058                    sb.append(name);
059                    sb.append(", description=");
060                    sb.append(description);
061                    sb.append(", type=");
062                    sb.append(type);
063                    sb.append(", typeSettings=");
064                    sb.append(typeSettings);
065                    sb.append(", manualMembership=");
066                    sb.append(manualMembership);
067                    sb.append(", membershipRestriction=");
068                    sb.append(membershipRestriction);
069                    sb.append(", friendlyURL=");
070                    sb.append(friendlyURL);
071                    sb.append(", site=");
072                    sb.append(site);
073                    sb.append(", remoteStagingGroupCount=");
074                    sb.append(remoteStagingGroupCount);
075                    sb.append(", active=");
076                    sb.append(active);
077                    sb.append("}");
078    
079                    return sb.toString();
080            }
081    
082            @Override
083            public Group toEntityModel() {
084                    GroupImpl groupImpl = new GroupImpl();
085    
086                    if (uuid == null) {
087                            groupImpl.setUuid(StringPool.BLANK);
088                    }
089                    else {
090                            groupImpl.setUuid(uuid);
091                    }
092    
093                    groupImpl.setGroupId(groupId);
094                    groupImpl.setCompanyId(companyId);
095                    groupImpl.setCreatorUserId(creatorUserId);
096                    groupImpl.setClassNameId(classNameId);
097                    groupImpl.setClassPK(classPK);
098                    groupImpl.setParentGroupId(parentGroupId);
099                    groupImpl.setLiveGroupId(liveGroupId);
100    
101                    if (treePath == null) {
102                            groupImpl.setTreePath(StringPool.BLANK);
103                    }
104                    else {
105                            groupImpl.setTreePath(treePath);
106                    }
107    
108                    if (name == null) {
109                            groupImpl.setName(StringPool.BLANK);
110                    }
111                    else {
112                            groupImpl.setName(name);
113                    }
114    
115                    if (description == null) {
116                            groupImpl.setDescription(StringPool.BLANK);
117                    }
118                    else {
119                            groupImpl.setDescription(description);
120                    }
121    
122                    groupImpl.setType(type);
123    
124                    if (typeSettings == null) {
125                            groupImpl.setTypeSettings(StringPool.BLANK);
126                    }
127                    else {
128                            groupImpl.setTypeSettings(typeSettings);
129                    }
130    
131                    groupImpl.setManualMembership(manualMembership);
132                    groupImpl.setMembershipRestriction(membershipRestriction);
133    
134                    if (friendlyURL == null) {
135                            groupImpl.setFriendlyURL(StringPool.BLANK);
136                    }
137                    else {
138                            groupImpl.setFriendlyURL(friendlyURL);
139                    }
140    
141                    groupImpl.setSite(site);
142                    groupImpl.setRemoteStagingGroupCount(remoteStagingGroupCount);
143                    groupImpl.setActive(active);
144    
145                    groupImpl.resetOriginalValues();
146    
147                    return groupImpl;
148            }
149    
150            @Override
151            public void readExternal(ObjectInput objectInput) throws IOException {
152                    uuid = objectInput.readUTF();
153                    groupId = objectInput.readLong();
154                    companyId = objectInput.readLong();
155                    creatorUserId = objectInput.readLong();
156                    classNameId = objectInput.readLong();
157                    classPK = objectInput.readLong();
158                    parentGroupId = objectInput.readLong();
159                    liveGroupId = objectInput.readLong();
160                    treePath = objectInput.readUTF();
161                    name = objectInput.readUTF();
162                    description = objectInput.readUTF();
163                    type = objectInput.readInt();
164                    typeSettings = objectInput.readUTF();
165                    manualMembership = objectInput.readBoolean();
166                    membershipRestriction = objectInput.readInt();
167                    friendlyURL = objectInput.readUTF();
168                    site = objectInput.readBoolean();
169                    remoteStagingGroupCount = objectInput.readInt();
170                    active = objectInput.readBoolean();
171            }
172    
173            @Override
174            public void writeExternal(ObjectOutput objectOutput)
175                    throws IOException {
176                    if (uuid == null) {
177                            objectOutput.writeUTF(StringPool.BLANK);
178                    }
179                    else {
180                            objectOutput.writeUTF(uuid);
181                    }
182    
183                    objectOutput.writeLong(groupId);
184                    objectOutput.writeLong(companyId);
185                    objectOutput.writeLong(creatorUserId);
186                    objectOutput.writeLong(classNameId);
187                    objectOutput.writeLong(classPK);
188                    objectOutput.writeLong(parentGroupId);
189                    objectOutput.writeLong(liveGroupId);
190    
191                    if (treePath == null) {
192                            objectOutput.writeUTF(StringPool.BLANK);
193                    }
194                    else {
195                            objectOutput.writeUTF(treePath);
196                    }
197    
198                    if (name == null) {
199                            objectOutput.writeUTF(StringPool.BLANK);
200                    }
201                    else {
202                            objectOutput.writeUTF(name);
203                    }
204    
205                    if (description == null) {
206                            objectOutput.writeUTF(StringPool.BLANK);
207                    }
208                    else {
209                            objectOutput.writeUTF(description);
210                    }
211    
212                    objectOutput.writeInt(type);
213    
214                    if (typeSettings == null) {
215                            objectOutput.writeUTF(StringPool.BLANK);
216                    }
217                    else {
218                            objectOutput.writeUTF(typeSettings);
219                    }
220    
221                    objectOutput.writeBoolean(manualMembership);
222                    objectOutput.writeInt(membershipRestriction);
223    
224                    if (friendlyURL == null) {
225                            objectOutput.writeUTF(StringPool.BLANK);
226                    }
227                    else {
228                            objectOutput.writeUTF(friendlyURL);
229                    }
230    
231                    objectOutput.writeBoolean(site);
232                    objectOutput.writeInt(remoteStagingGroupCount);
233                    objectOutput.writeBoolean(active);
234            }
235    
236            public String uuid;
237            public long groupId;
238            public long companyId;
239            public long creatorUserId;
240            public long classNameId;
241            public long classPK;
242            public long parentGroupId;
243            public long liveGroupId;
244            public String treePath;
245            public String name;
246            public String description;
247            public int type;
248            public String typeSettings;
249            public boolean manualMembership;
250            public int membershipRestriction;
251            public String friendlyURL;
252            public boolean site;
253            public int remoteStagingGroupCount;
254            public boolean active;
255    }