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.util.HashUtil;
020    import com.liferay.portal.kernel.util.StringBundler;
021    import com.liferay.portal.model.CacheModel;
022    import com.liferay.portal.model.MVCCModel;
023    import com.liferay.portal.model.OrgLabor;
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(37);
080    
081                    sb.append("{mvccVersion=");
082                    sb.append(mvccVersion);
083                    sb.append(", orgLaborId=");
084                    sb.append(orgLaborId);
085                    sb.append(", organizationId=");
086                    sb.append(organizationId);
087                    sb.append(", typeId=");
088                    sb.append(typeId);
089                    sb.append(", sunOpen=");
090                    sb.append(sunOpen);
091                    sb.append(", sunClose=");
092                    sb.append(sunClose);
093                    sb.append(", monOpen=");
094                    sb.append(monOpen);
095                    sb.append(", monClose=");
096                    sb.append(monClose);
097                    sb.append(", tueOpen=");
098                    sb.append(tueOpen);
099                    sb.append(", tueClose=");
100                    sb.append(tueClose);
101                    sb.append(", wedOpen=");
102                    sb.append(wedOpen);
103                    sb.append(", wedClose=");
104                    sb.append(wedClose);
105                    sb.append(", thuOpen=");
106                    sb.append(thuOpen);
107                    sb.append(", thuClose=");
108                    sb.append(thuClose);
109                    sb.append(", friOpen=");
110                    sb.append(friOpen);
111                    sb.append(", friClose=");
112                    sb.append(friClose);
113                    sb.append(", satOpen=");
114                    sb.append(satOpen);
115                    sb.append(", satClose=");
116                    sb.append(satClose);
117                    sb.append("}");
118    
119                    return sb.toString();
120            }
121    
122            @Override
123            public OrgLabor toEntityModel() {
124                    OrgLaborImpl orgLaborImpl = new OrgLaborImpl();
125    
126                    orgLaborImpl.setMvccVersion(mvccVersion);
127                    orgLaborImpl.setOrgLaborId(orgLaborId);
128                    orgLaborImpl.setOrganizationId(organizationId);
129                    orgLaborImpl.setTypeId(typeId);
130                    orgLaborImpl.setSunOpen(sunOpen);
131                    orgLaborImpl.setSunClose(sunClose);
132                    orgLaborImpl.setMonOpen(monOpen);
133                    orgLaborImpl.setMonClose(monClose);
134                    orgLaborImpl.setTueOpen(tueOpen);
135                    orgLaborImpl.setTueClose(tueClose);
136                    orgLaborImpl.setWedOpen(wedOpen);
137                    orgLaborImpl.setWedClose(wedClose);
138                    orgLaborImpl.setThuOpen(thuOpen);
139                    orgLaborImpl.setThuClose(thuClose);
140                    orgLaborImpl.setFriOpen(friOpen);
141                    orgLaborImpl.setFriClose(friClose);
142                    orgLaborImpl.setSatOpen(satOpen);
143                    orgLaborImpl.setSatClose(satClose);
144    
145                    orgLaborImpl.resetOriginalValues();
146    
147                    return orgLaborImpl;
148            }
149    
150            @Override
151            public void readExternal(ObjectInput objectInput) throws IOException {
152                    mvccVersion = objectInput.readLong();
153                    orgLaborId = objectInput.readLong();
154                    organizationId = objectInput.readLong();
155                    typeId = objectInput.readLong();
156                    sunOpen = objectInput.readInt();
157                    sunClose = objectInput.readInt();
158                    monOpen = objectInput.readInt();
159                    monClose = objectInput.readInt();
160                    tueOpen = objectInput.readInt();
161                    tueClose = objectInput.readInt();
162                    wedOpen = objectInput.readInt();
163                    wedClose = objectInput.readInt();
164                    thuOpen = objectInput.readInt();
165                    thuClose = objectInput.readInt();
166                    friOpen = objectInput.readInt();
167                    friClose = objectInput.readInt();
168                    satOpen = objectInput.readInt();
169                    satClose = objectInput.readInt();
170            }
171    
172            @Override
173            public void writeExternal(ObjectOutput objectOutput)
174                    throws IOException {
175                    objectOutput.writeLong(mvccVersion);
176                    objectOutput.writeLong(orgLaborId);
177                    objectOutput.writeLong(organizationId);
178                    objectOutput.writeLong(typeId);
179                    objectOutput.writeInt(sunOpen);
180                    objectOutput.writeInt(sunClose);
181                    objectOutput.writeInt(monOpen);
182                    objectOutput.writeInt(monClose);
183                    objectOutput.writeInt(tueOpen);
184                    objectOutput.writeInt(tueClose);
185                    objectOutput.writeInt(wedOpen);
186                    objectOutput.writeInt(wedClose);
187                    objectOutput.writeInt(thuOpen);
188                    objectOutput.writeInt(thuClose);
189                    objectOutput.writeInt(friOpen);
190                    objectOutput.writeInt(friClose);
191                    objectOutput.writeInt(satOpen);
192                    objectOutput.writeInt(satClose);
193            }
194    
195            public long mvccVersion;
196            public long orgLaborId;
197            public long organizationId;
198            public long typeId;
199            public int sunOpen;
200            public int sunClose;
201            public int monOpen;
202            public int monClose;
203            public int tueOpen;
204            public int tueClose;
205            public int wedOpen;
206            public int wedClose;
207            public int thuOpen;
208            public int thuClose;
209            public int friOpen;
210            public int friClose;
211            public int satOpen;
212            public int satClose;
213    }