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.portlet.dynamicdatamapping.model.impl;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.util.StringBundler;
020    import com.liferay.portal.model.CacheModel;
021    
022    import com.liferay.portlet.dynamicdatamapping.model.DDMStructureLink;
023    
024    import java.io.Externalizable;
025    import java.io.IOException;
026    import java.io.ObjectInput;
027    import java.io.ObjectOutput;
028    
029    /**
030     * The cache model class for representing DDMStructureLink in entity cache.
031     *
032     * @author Brian Wing Shun Chan
033     * @see DDMStructureLink
034     * @generated
035     */
036    @ProviderType
037    public class DDMStructureLinkCacheModel implements CacheModel<DDMStructureLink>,
038            Externalizable {
039            @Override
040            public String toString() {
041                    StringBundler sb = new StringBundler(9);
042    
043                    sb.append("{structureLinkId=");
044                    sb.append(structureLinkId);
045                    sb.append(", classNameId=");
046                    sb.append(classNameId);
047                    sb.append(", classPK=");
048                    sb.append(classPK);
049                    sb.append(", structureId=");
050                    sb.append(structureId);
051                    sb.append("}");
052    
053                    return sb.toString();
054            }
055    
056            @Override
057            public DDMStructureLink toEntityModel() {
058                    DDMStructureLinkImpl ddmStructureLinkImpl = new DDMStructureLinkImpl();
059    
060                    ddmStructureLinkImpl.setStructureLinkId(structureLinkId);
061                    ddmStructureLinkImpl.setClassNameId(classNameId);
062                    ddmStructureLinkImpl.setClassPK(classPK);
063                    ddmStructureLinkImpl.setStructureId(structureId);
064    
065                    ddmStructureLinkImpl.resetOriginalValues();
066    
067                    return ddmStructureLinkImpl;
068            }
069    
070            @Override
071            public void readExternal(ObjectInput objectInput) throws IOException {
072                    structureLinkId = objectInput.readLong();
073                    classNameId = objectInput.readLong();
074                    classPK = objectInput.readLong();
075                    structureId = objectInput.readLong();
076            }
077    
078            @Override
079            public void writeExternal(ObjectOutput objectOutput)
080                    throws IOException {
081                    objectOutput.writeLong(structureLinkId);
082                    objectOutput.writeLong(classNameId);
083                    objectOutput.writeLong(classPK);
084                    objectOutput.writeLong(structureId);
085            }
086    
087            public long structureLinkId;
088            public long classNameId;
089            public long classPK;
090            public long structureId;
091    }