001    /**
002     * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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     * <p>
024     * This class is used by
025     * {@link com.liferay.portal.service.http.PortletServiceSoap}.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       com.liferay.portal.service.http.PortletServiceSoap
030     * @generated
031     */
032    public class PortletSoap implements Serializable {
033            public static PortletSoap toSoapModel(Portlet model) {
034                    PortletSoap soapModel = new PortletSoap();
035    
036                    soapModel.setId(model.getId());
037                    soapModel.setCompanyId(model.getCompanyId());
038                    soapModel.setPortletId(model.getPortletId());
039                    soapModel.setRoles(model.getRoles());
040                    soapModel.setActive(model.getActive());
041    
042                    return soapModel;
043            }
044    
045            public static PortletSoap[] toSoapModels(Portlet[] models) {
046                    PortletSoap[] soapModels = new PortletSoap[models.length];
047    
048                    for (int i = 0; i < models.length; i++) {
049                            soapModels[i] = toSoapModel(models[i]);
050                    }
051    
052                    return soapModels;
053            }
054    
055            public static PortletSoap[][] toSoapModels(Portlet[][] models) {
056                    PortletSoap[][] soapModels = null;
057    
058                    if (models.length > 0) {
059                            soapModels = new PortletSoap[models.length][models[0].length];
060                    }
061                    else {
062                            soapModels = new PortletSoap[0][0];
063                    }
064    
065                    for (int i = 0; i < models.length; i++) {
066                            soapModels[i] = toSoapModels(models[i]);
067                    }
068    
069                    return soapModels;
070            }
071    
072            public static PortletSoap[] toSoapModels(List<Portlet> models) {
073                    List<PortletSoap> soapModels = new ArrayList<PortletSoap>(models.size());
074    
075                    for (Portlet model : models) {
076                            soapModels.add(toSoapModel(model));
077                    }
078    
079                    return soapModels.toArray(new PortletSoap[soapModels.size()]);
080            }
081    
082            public PortletSoap() {
083            }
084    
085            public long getPrimaryKey() {
086                    return _id;
087            }
088    
089            public void setPrimaryKey(long pk) {
090                    setId(pk);
091            }
092    
093            public long getId() {
094                    return _id;
095            }
096    
097            public void setId(long id) {
098                    _id = id;
099            }
100    
101            public long getCompanyId() {
102                    return _companyId;
103            }
104    
105            public void setCompanyId(long companyId) {
106                    _companyId = companyId;
107            }
108    
109            public String getPortletId() {
110                    return _portletId;
111            }
112    
113            public void setPortletId(String portletId) {
114                    _portletId = portletId;
115            }
116    
117            public String getRoles() {
118                    return _roles;
119            }
120    
121            public void setRoles(String roles) {
122                    _roles = roles;
123            }
124    
125            public boolean getActive() {
126                    return _active;
127            }
128    
129            public boolean isActive() {
130                    return _active;
131            }
132    
133            public void setActive(boolean active) {
134                    _active = active;
135            }
136    
137            private long _id;
138            private long _companyId;
139            private String _portletId;
140            private String _roles;
141            private boolean _active;
142    }