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.model;
016    
017    import java.io.Serializable;
018    
019    import java.util.ArrayList;
020    import java.util.List;
021    
022    /**
023     * This class is used by SOAP remote services, specifically {@link com.liferay.portal.service.http.PortletServiceSoap}.
024     *
025     * @author Brian Wing Shun Chan
026     * @see com.liferay.portal.service.http.PortletServiceSoap
027     * @generated
028     */
029    public class PortletSoap implements Serializable {
030            public static PortletSoap toSoapModel(Portlet model) {
031                    PortletSoap soapModel = new PortletSoap();
032    
033                    soapModel.setId(model.getId());
034                    soapModel.setCompanyId(model.getCompanyId());
035                    soapModel.setPortletId(model.getPortletId());
036                    soapModel.setRoles(model.getRoles());
037                    soapModel.setActive(model.getActive());
038    
039                    return soapModel;
040            }
041    
042            public static PortletSoap[] toSoapModels(Portlet[] models) {
043                    PortletSoap[] soapModels = new PortletSoap[models.length];
044    
045                    for (int i = 0; i < models.length; i++) {
046                            soapModels[i] = toSoapModel(models[i]);
047                    }
048    
049                    return soapModels;
050            }
051    
052            public static PortletSoap[][] toSoapModels(Portlet[][] models) {
053                    PortletSoap[][] soapModels = null;
054    
055                    if (models.length > 0) {
056                            soapModels = new PortletSoap[models.length][models[0].length];
057                    }
058                    else {
059                            soapModels = new PortletSoap[0][0];
060                    }
061    
062                    for (int i = 0; i < models.length; i++) {
063                            soapModels[i] = toSoapModels(models[i]);
064                    }
065    
066                    return soapModels;
067            }
068    
069            public static PortletSoap[] toSoapModels(List<Portlet> models) {
070                    List<PortletSoap> soapModels = new ArrayList<PortletSoap>(models.size());
071    
072                    for (Portlet model : models) {
073                            soapModels.add(toSoapModel(model));
074                    }
075    
076                    return soapModels.toArray(new PortletSoap[soapModels.size()]);
077            }
078    
079            public PortletSoap() {
080            }
081    
082            public long getPrimaryKey() {
083                    return _id;
084            }
085    
086            public void setPrimaryKey(long pk) {
087                    setId(pk);
088            }
089    
090            public long getId() {
091                    return _id;
092            }
093    
094            public void setId(long id) {
095                    _id = id;
096            }
097    
098            public long getCompanyId() {
099                    return _companyId;
100            }
101    
102            public void setCompanyId(long companyId) {
103                    _companyId = companyId;
104            }
105    
106            public String getPortletId() {
107                    return _portletId;
108            }
109    
110            public void setPortletId(String portletId) {
111                    _portletId = portletId;
112            }
113    
114            public String getRoles() {
115                    return _roles;
116            }
117    
118            public void setRoles(String roles) {
119                    _roles = roles;
120            }
121    
122            public boolean getActive() {
123                    return _active;
124            }
125    
126            public boolean isActive() {
127                    return _active;
128            }
129    
130            public void setActive(boolean active) {
131                    _active = active;
132            }
133    
134            private long _id;
135            private long _companyId;
136            private String _portletId;
137            private String _roles;
138            private boolean _active;
139    }