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.documentlibrary.model.impl;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.util.StringBundler;
020    import com.liferay.portal.kernel.util.StringPool;
021    import com.liferay.portal.model.CacheModel;
022    
023    import com.liferay.portlet.documentlibrary.model.DLFileEntryMetadata;
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 DLFileEntryMetadata in entity cache.
032     *
033     * @author Brian Wing Shun Chan
034     * @see DLFileEntryMetadata
035     * @generated
036     */
037    @ProviderType
038    public class DLFileEntryMetadataCacheModel implements CacheModel<DLFileEntryMetadata>,
039            Externalizable {
040            @Override
041            public String toString() {
042                    StringBundler sb = new StringBundler(15);
043    
044                    sb.append("{uuid=");
045                    sb.append(uuid);
046                    sb.append(", fileEntryMetadataId=");
047                    sb.append(fileEntryMetadataId);
048                    sb.append(", DDMStorageId=");
049                    sb.append(DDMStorageId);
050                    sb.append(", DDMStructureId=");
051                    sb.append(DDMStructureId);
052                    sb.append(", fileEntryTypeId=");
053                    sb.append(fileEntryTypeId);
054                    sb.append(", fileEntryId=");
055                    sb.append(fileEntryId);
056                    sb.append(", fileVersionId=");
057                    sb.append(fileVersionId);
058                    sb.append("}");
059    
060                    return sb.toString();
061            }
062    
063            @Override
064            public DLFileEntryMetadata toEntityModel() {
065                    DLFileEntryMetadataImpl dlFileEntryMetadataImpl = new DLFileEntryMetadataImpl();
066    
067                    if (uuid == null) {
068                            dlFileEntryMetadataImpl.setUuid(StringPool.BLANK);
069                    }
070                    else {
071                            dlFileEntryMetadataImpl.setUuid(uuid);
072                    }
073    
074                    dlFileEntryMetadataImpl.setFileEntryMetadataId(fileEntryMetadataId);
075                    dlFileEntryMetadataImpl.setDDMStorageId(DDMStorageId);
076                    dlFileEntryMetadataImpl.setDDMStructureId(DDMStructureId);
077                    dlFileEntryMetadataImpl.setFileEntryTypeId(fileEntryTypeId);
078                    dlFileEntryMetadataImpl.setFileEntryId(fileEntryId);
079                    dlFileEntryMetadataImpl.setFileVersionId(fileVersionId);
080    
081                    dlFileEntryMetadataImpl.resetOriginalValues();
082    
083                    return dlFileEntryMetadataImpl;
084            }
085    
086            @Override
087            public void readExternal(ObjectInput objectInput) throws IOException {
088                    uuid = objectInput.readUTF();
089                    fileEntryMetadataId = objectInput.readLong();
090                    DDMStorageId = objectInput.readLong();
091                    DDMStructureId = objectInput.readLong();
092                    fileEntryTypeId = objectInput.readLong();
093                    fileEntryId = objectInput.readLong();
094                    fileVersionId = objectInput.readLong();
095            }
096    
097            @Override
098            public void writeExternal(ObjectOutput objectOutput)
099                    throws IOException {
100                    if (uuid == null) {
101                            objectOutput.writeUTF(StringPool.BLANK);
102                    }
103                    else {
104                            objectOutput.writeUTF(uuid);
105                    }
106    
107                    objectOutput.writeLong(fileEntryMetadataId);
108                    objectOutput.writeLong(DDMStorageId);
109                    objectOutput.writeLong(DDMStructureId);
110                    objectOutput.writeLong(fileEntryTypeId);
111                    objectOutput.writeLong(fileEntryId);
112                    objectOutput.writeLong(fileVersionId);
113            }
114    
115            public String uuid;
116            public long fileEntryMetadataId;
117            public long DDMStorageId;
118            public long DDMStructureId;
119            public long fileEntryTypeId;
120            public long fileEntryId;
121            public long fileVersionId;
122    }