/** * Copyright (c) 2000-present Liferay, Inc. All rights reserved. * * This library is free software; you can redistribute it and/or modify it under * the terms of the GNU Lesser General Public License as published by the Free * Software Foundation; either version 2.1 of the License, or (at your option) * any later version. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. */ package com.liferay.roster.model.impl; import aQute.bnd.annotation.ProviderType; import com.liferay.portal.kernel.model.CacheModel; import com.liferay.portal.kernel.util.HashUtil; import com.liferay.portal.kernel.util.StringBundler; import com.liferay.portal.kernel.util.StringPool; import com.liferay.roster.model.Club; import java.io.Externalizable; import java.io.IOException; import java.io.ObjectInput; import java.io.ObjectOutput; import java.util.Date; /** * The cache model class for representing Club in entity cache. * * @author Brian Wing Shun Chan * @see Club * @generated */ @ProviderType public class ClubCacheModel implements CacheModel<Club>, Externalizable { @Override public boolean equals(Object obj) { if (this == obj) { return true; } if (!(obj instanceof ClubCacheModel)) { return false; } ClubCacheModel clubCacheModel = (ClubCacheModel)obj; if (clubId == clubCacheModel.clubId) { return true; } return false; } @Override public int hashCode() { return HashUtil.hash(0, clubId); } @Override public String toString() { StringBundler sb = new StringBundler(11); sb.append("{uuid="); sb.append(uuid); sb.append(", clubId="); sb.append(clubId); sb.append(", createDate="); sb.append(createDate); sb.append(", modifiedDate="); sb.append(modifiedDate); sb.append(", name="); sb.append(name); sb.append("}"); return sb.toString(); } @Override public Club toEntityModel() { ClubImpl clubImpl = new ClubImpl(); if (uuid == null) { clubImpl.setUuid(StringPool.BLANK); } else { clubImpl.setUuid(uuid); } clubImpl.setClubId(clubId); if (createDate == Long.MIN_VALUE) { clubImpl.setCreateDate(null); } else { clubImpl.setCreateDate(new Date(createDate)); } if (modifiedDate == Long.MIN_VALUE) { clubImpl.setModifiedDate(null); } else { clubImpl.setModifiedDate(new Date(modifiedDate)); } if (name == null) { clubImpl.setName(StringPool.BLANK); } else { clubImpl.setName(name); } clubImpl.resetOriginalValues(); return clubImpl; } @Override public void readExternal(ObjectInput objectInput) throws IOException { uuid = objectInput.readUTF(); clubId = objectInput.readLong(); createDate = objectInput.readLong(); modifiedDate = objectInput.readLong(); name = objectInput.readUTF(); } @Override public void writeExternal(ObjectOutput objectOutput) throws IOException { if (uuid == null) { objectOutput.writeUTF(StringPool.BLANK); } else { objectOutput.writeUTF(uuid); } objectOutput.writeLong(clubId); objectOutput.writeLong(createDate); objectOutput.writeLong(modifiedDate); if (name == null) { objectOutput.writeUTF(StringPool.BLANK); } else { objectOutput.writeUTF(name); } } public String uuid; public long clubId; public long createDate; public long modifiedDate; public String name; }