001    /**
002     * Copyright (c) 2000-2012 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.kernel.repository.model;
016    
017    import java.io.Serializable;
018    import java.util.ArrayList;
019    import java.util.Date;
020    import java.util.List;
021    
022    /**
023     * @author Alexander Chow
024     */
025    public class FolderSoap implements Serializable {
026    
027            public static FolderSoap toSoapModel(Folder model) {
028                    FolderSoap soapModel = new FolderSoap();
029    
030                    soapModel.setUuid(model.getUuid());
031                    soapModel.setFolderId(model.getFolderId());
032                    soapModel.setGroupId(model.getGroupId());
033                    soapModel.setCompanyId(model.getCompanyId());
034                    soapModel.setUserId(model.getUserId());
035                    soapModel.setUserName(model.getUserName());
036                    soapModel.setCreateDate(model.getCreateDate());
037                    soapModel.setModifiedDate(model.getModifiedDate());
038                    soapModel.setRepositoryId(model.getRepositoryId());
039                    soapModel.setParentFolderId(model.getParentFolderId());
040                    soapModel.setName(model.getName());
041                    soapModel.setDescription(model.getDescription());
042                    soapModel.setLastPostDate(model.getLastPostDate());
043    
044                    return soapModel;
045            }
046    
047            public static FolderSoap[] toSoapModels(Folder[] models) {
048                    FolderSoap[] soapModels = new FolderSoap[models.length];
049    
050                    for (int i = 0; i < models.length; i++) {
051                            soapModels[i] = toSoapModel(models[i]);
052                    }
053    
054                    return soapModels;
055            }
056    
057            public static FolderSoap[][] toSoapModels(Folder[][] models) {
058                    FolderSoap[][] soapModels = null;
059    
060                    if (models.length > 0) {
061                            soapModels = new FolderSoap[models.length][models[0].length];
062                    }
063                    else {
064                            soapModels = new FolderSoap[0][0];
065                    }
066    
067                    for (int i = 0; i < models.length; i++) {
068                            soapModels[i] = toSoapModels(models[i]);
069                    }
070    
071                    return soapModels;
072            }
073    
074            public static FolderSoap[] toSoapModels(List<Folder> models) {
075                    List<FolderSoap> soapModels = new ArrayList<FolderSoap>(models.size());
076    
077                    for (Folder model : models) {
078                            soapModels.add(toSoapModel(model));
079                    }
080    
081                    return soapModels.toArray(new FolderSoap[soapModels.size()]);
082            }
083    
084            public FolderSoap() {
085            }
086    
087            public long getCompanyId() {
088                    return _companyId;
089            }
090    
091            public Date getCreateDate() {
092                    return _createDate;
093            }
094    
095            public String getDescription() {
096                    return _description;
097            }
098    
099            public long getFolderId() {
100                    return _folderId;
101            }
102    
103            public long getGroupId() {
104                    return _groupId;
105            }
106    
107            public Date getLastPostDate() {
108                    return _lastPostDate;
109            }
110    
111            public Date getModifiedDate() {
112                    return _modifiedDate;
113            }
114    
115            public String getName() {
116                    return _name;
117            }
118    
119            public long getParentFolderId() {
120                    return _parentFolderId;
121            }
122    
123            public long getPrimaryKey() {
124                    return _folderId;
125            }
126    
127            public long getRepositoryId() {
128                    return _repositoryId;
129            }
130    
131            public long getUserId() {
132                    return _userId;
133            }
134    
135            public String getUserName() {
136                    return _userName;
137            }
138    
139            public String getUuid() {
140                    return _uuid;
141            }
142    
143            public void setCompanyId(long companyId) {
144                    _companyId = companyId;
145            }
146    
147            public void setCreateDate(Date createDate) {
148                    _createDate = createDate;
149            }
150    
151            public void setDescription(String description) {
152                    _description = description;
153            }
154    
155            public void setFolderId(long folderId) {
156                    _folderId = folderId;
157            }
158    
159            public void setGroupId(long groupId) {
160                    _groupId = groupId;
161            }
162    
163            public void setLastPostDate(Date lastPostDate) {
164                    _lastPostDate = lastPostDate;
165            }
166    
167            public void setModifiedDate(Date modifiedDate) {
168                    _modifiedDate = modifiedDate;
169            }
170    
171            public void setName(String name) {
172                    _name = name;
173            }
174    
175            public void setParentFolderId(long parentFolderId) {
176                    _parentFolderId = parentFolderId;
177            }
178    
179            public void setPrimaryKey(long pk) {
180                    setFolderId(pk);
181            }
182    
183            public void setRepositoryId(long repositoryId) {
184                    _repositoryId = repositoryId;
185            }
186    
187            public void setUserId(long userId) {
188                    _userId = userId;
189            }
190    
191            public void setUserName(String userName) {
192                    _userName = userName;
193            }
194    
195            public void setUuid(String uuid) {
196                    _uuid = uuid;
197            }
198    
199            private String _uuid;
200            private long _folderId;
201            private long _groupId;
202            private long _companyId;
203            private long _userId;
204            private String _userName;
205            private Date _createDate;
206            private Date _modifiedDate;
207            private long _repositoryId;
208            private long _parentFolderId;
209            private String _name;
210            private String _description;
211            private Date _lastPostDate;
212    
213    }