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