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.PasswordPolicyRel;
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 PasswordPolicyRel in entity cache.
032     *
033     * @author Brian Wing Shun Chan
034     * @see PasswordPolicyRel
035     * @generated
036     */
037    @ProviderType
038    public class PasswordPolicyRelCacheModel implements CacheModel<PasswordPolicyRel>,
039            Externalizable, MVCCModel {
040            @Override
041            public boolean equals(Object obj) {
042                    if (this == obj) {
043                            return true;
044                    }
045    
046                    if (!(obj instanceof PasswordPolicyRelCacheModel)) {
047                            return false;
048                    }
049    
050                    PasswordPolicyRelCacheModel passwordPolicyRelCacheModel = (PasswordPolicyRelCacheModel)obj;
051    
052                    if ((passwordPolicyRelId == passwordPolicyRelCacheModel.passwordPolicyRelId) &&
053                                    (mvccVersion == passwordPolicyRelCacheModel.mvccVersion)) {
054                            return true;
055                    }
056    
057                    return false;
058            }
059    
060            @Override
061            public int hashCode() {
062                    int hashCode = HashUtil.hash(0, passwordPolicyRelId);
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(11);
080    
081                    sb.append("{mvccVersion=");
082                    sb.append(mvccVersion);
083                    sb.append(", passwordPolicyRelId=");
084                    sb.append(passwordPolicyRelId);
085                    sb.append(", passwordPolicyId=");
086                    sb.append(passwordPolicyId);
087                    sb.append(", classNameId=");
088                    sb.append(classNameId);
089                    sb.append(", classPK=");
090                    sb.append(classPK);
091                    sb.append("}");
092    
093                    return sb.toString();
094            }
095    
096            @Override
097            public PasswordPolicyRel toEntityModel() {
098                    PasswordPolicyRelImpl passwordPolicyRelImpl = new PasswordPolicyRelImpl();
099    
100                    passwordPolicyRelImpl.setMvccVersion(mvccVersion);
101                    passwordPolicyRelImpl.setPasswordPolicyRelId(passwordPolicyRelId);
102                    passwordPolicyRelImpl.setPasswordPolicyId(passwordPolicyId);
103                    passwordPolicyRelImpl.setClassNameId(classNameId);
104                    passwordPolicyRelImpl.setClassPK(classPK);
105    
106                    passwordPolicyRelImpl.resetOriginalValues();
107    
108                    return passwordPolicyRelImpl;
109            }
110    
111            @Override
112            public void readExternal(ObjectInput objectInput) throws IOException {
113                    mvccVersion = objectInput.readLong();
114                    passwordPolicyRelId = objectInput.readLong();
115                    passwordPolicyId = objectInput.readLong();
116                    classNameId = objectInput.readLong();
117                    classPK = objectInput.readLong();
118            }
119    
120            @Override
121            public void writeExternal(ObjectOutput objectOutput)
122                    throws IOException {
123                    objectOutput.writeLong(mvccVersion);
124                    objectOutput.writeLong(passwordPolicyRelId);
125                    objectOutput.writeLong(passwordPolicyId);
126                    objectOutput.writeLong(classNameId);
127                    objectOutput.writeLong(classPK);
128            }
129    
130            public long mvccVersion;
131            public long passwordPolicyRelId;
132            public long passwordPolicyId;
133            public long classNameId;
134            public long classPK;
135    }