001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.model.CacheModel;
020    import com.liferay.portal.kernel.model.MVCCModel;
021    import com.liferay.portal.kernel.model.OrgLabor;
022    import com.liferay.portal.kernel.util.HashUtil;
023    import com.liferay.portal.kernel.util.StringBundler;
024    
025    import java.io.Externalizable;
026    import java.io.IOException;
027    import java.io.ObjectInput;
028    import java.io.ObjectOutput;
029    
030    /**
031     * The cache model class for representing OrgLabor in entity cache.
032     *
033     * @author Brian Wing Shun Chan
034     * @see OrgLabor
035     * @generated
036     */
037    @ProviderType
038    public class OrgLaborCacheModel implements CacheModel<OrgLabor>, Externalizable,
039            MVCCModel {
040            @Override
041            public boolean equals(Object obj) {
042                    if (this == obj) {
043                            return true;
044                    }
045    
046                    if (!(obj instanceof OrgLaborCacheModel)) {
047                            return false;
048                    }
049    
050                    OrgLaborCacheModel orgLaborCacheModel = (OrgLaborCacheModel)obj;
051    
052                    if ((orgLaborId == orgLaborCacheModel.orgLaborId) &&
053                                    (mvccVersion == orgLaborCacheModel.mvccVersion)) {
054                            return true;
055                    }
056    
057                    return false;
058            }
059    
060            @Override
061            public int hashCode() {
062                    int hashCode = HashUtil.hash(0, orgLaborId);
063    
064                    return HashUtil.hash(hashCode, mvccVersion);
065            }
066    
067            @Override
068            public long getMvccVersion() {
069                    return mvccVersion;
070            }
071    
072            @Override
073            public void setMvccVersion(long mvccVersion) {
074                    this.mvccVersion = mvccVersion;
075            }
076    
077            @Override
078            public String toString() {
079                    StringBundler sb = new StringBundler(39);
080    
081                    sb.append("{mvccVersion=");
082                    sb.append(mvccVersion);
083                    sb.append(", orgLaborId=");
084                    sb.append(orgLaborId);
085                    sb.append(", companyId=");
086                    sb.append(companyId);
087                    sb.append(", organizationId=");
088                    sb.append(organizationId);
089                    sb.append(", typeId=");
090                    sb.append(typeId);
091                    sb.append(", sunOpen=");
092                    sb.append(sunOpen);
093                    sb.append(", sunClose=");
094                    sb.append(sunClose);
095                    sb.append(", monOpen=");
096                    sb.append(monOpen);
097                    sb.append(", monClose=");
098                    sb.append(monClose);
099                    sb.append(", tueOpen=");
100                    sb.append(tueOpen);
101                    sb.append(", tueClose=");
102                    sb.append(tueClose);
103                    sb.append(", wedOpen=");
104                    sb.append(wedOpen);
105                    sb.append(", wedClose=");
106                    sb.append(wedClose);
107                    sb.append(", thuOpen=");
108                    sb.append(thuOpen);
109                    sb.append(", thuClose=");
110                    sb.append(thuClose);
111                    sb.append(", friOpen=");
112                    sb.append(friOpen);
113                    sb.append(", friClose=");
114                    sb.append(friClose);
115                    sb.append(", satOpen=");
116                    sb.append(satOpen);
117                    sb.append(", satClose=");
118                    sb.append(satClose);
119                    sb.append("}");
120    
121                    return sb.toString();
122            }
123    
124            @Override
125            public OrgLabor toEntityModel() {
126                    OrgLaborImpl orgLaborImpl = new OrgLaborImpl();
127    
128                    orgLaborImpl.setMvccVersion(mvccVersion);
129                    orgLaborImpl.setOrgLaborId(orgLaborId);
130                    orgLaborImpl.setCompanyId(companyId);
131                    orgLaborImpl.setOrganizationId(organizationId);
132                    orgLaborImpl.setTypeId(typeId);
133                    orgLaborImpl.setSunOpen(sunOpen);
134                    orgLaborImpl.setSunClose(sunClose);
135                    orgLaborImpl.setMonOpen(monOpen);
136                    orgLaborImpl.setMonClose(monClose);
137                    orgLaborImpl.setTueOpen(tueOpen);
138                    orgLaborImpl.setTueClose(tueClose);
139                    orgLaborImpl.setWedOpen(wedOpen);
140                    orgLaborImpl.setWedClose(wedClose);
141                    orgLaborImpl.setThuOpen(thuOpen);
142                    orgLaborImpl.setThuClose(thuClose);
143                    orgLaborImpl.setFriOpen(friOpen);
144                    orgLaborImpl.setFriClose(friClose);
145                    orgLaborImpl.setSatOpen(satOpen);
146                    orgLaborImpl.setSatClose(satClose);
147    
148                    orgLaborImpl.resetOriginalValues();
149    
150                    return orgLaborImpl;
151            }
152    
153            @Override
154            public void readExternal(ObjectInput objectInput) throws IOException {
155                    mvccVersion = objectInput.readLong();
156    
157                    orgLaborId = objectInput.readLong();
158    
159                    companyId = objectInput.readLong();
160    
161                    organizationId = objectInput.readLong();
162    
163                    typeId = objectInput.readLong();
164    
165                    sunOpen = objectInput.readInt();
166    
167                    sunClose = objectInput.readInt();
168    
169                    monOpen = objectInput.readInt();
170    
171                    monClose = objectInput.readInt();
172    
173                    tueOpen = objectInput.readInt();
174    
175                    tueClose = objectInput.readInt();
176    
177                    wedOpen = objectInput.readInt();
178    
179                    wedClose = objectInput.readInt();
180    
181                    thuOpen = objectInput.readInt();
182    
183                    thuClose = objectInput.readInt();
184    
185                    friOpen = objectInput.readInt();
186    
187                    friClose = objectInput.readInt();
188    
189                    satOpen = objectInput.readInt();
190    
191                    satClose = objectInput.readInt();
192            }
193    
194            @Override
195            public void writeExternal(ObjectOutput objectOutput)
196                    throws IOException {
197                    objectOutput.writeLong(mvccVersion);
198    
199                    objectOutput.writeLong(orgLaborId);
200    
201                    objectOutput.writeLong(companyId);
202    
203                    objectOutput.writeLong(organizationId);
204    
205                    objectOutput.writeLong(typeId);
206    
207                    objectOutput.writeInt(sunOpen);
208    
209                    objectOutput.writeInt(sunClose);
210    
211                    objectOutput.writeInt(monOpen);
212    
213                    objectOutput.writeInt(monClose);
214    
215                    objectOutput.writeInt(tueOpen);
216    
217                    objectOutput.writeInt(tueClose);
218    
219                    objectOutput.writeInt(wedOpen);
220    
221                    objectOutput.writeInt(wedClose);
222    
223                    objectOutput.writeInt(thuOpen);
224    
225                    objectOutput.writeInt(thuClose);
226    
227                    objectOutput.writeInt(friOpen);
228    
229                    objectOutput.writeInt(friClose);
230    
231                    objectOutput.writeInt(satOpen);
232    
233                    objectOutput.writeInt(satClose);
234            }
235    
236            public long mvccVersion;
237            public long orgLaborId;
238            public long companyId;
239            public long organizationId;
240            public long typeId;
241            public int sunOpen;
242            public int sunClose;
243            public int monOpen;
244            public int monClose;
245            public int tueOpen;
246            public int tueClose;
247            public int wedOpen;
248            public int wedClose;
249            public int thuOpen;
250            public int thuClose;
251            public int friOpen;
252            public int friClose;
253            public int satOpen;
254            public int satClose;
255    }