001    /**
002     * Copyright (c) 2000-2010 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     * <p>
024     * This class is used by
025     * {@link com.liferay.portal.service.http.PortletPreferencesServiceSoap}.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       com.liferay.portal.service.http.PortletPreferencesServiceSoap
030     * @generated
031     */
032    public class PortletPreferencesSoap implements Serializable {
033            public static PortletPreferencesSoap toSoapModel(PortletPreferences model) {
034                    PortletPreferencesSoap soapModel = new PortletPreferencesSoap();
035    
036                    soapModel.setPortletPreferencesId(model.getPortletPreferencesId());
037                    soapModel.setOwnerId(model.getOwnerId());
038                    soapModel.setOwnerType(model.getOwnerType());
039                    soapModel.setPlid(model.getPlid());
040                    soapModel.setPortletId(model.getPortletId());
041                    soapModel.setPreferences(model.getPreferences());
042    
043                    return soapModel;
044            }
045    
046            public static PortletPreferencesSoap[] toSoapModels(
047                    PortletPreferences[] models) {
048                    PortletPreferencesSoap[] soapModels = new PortletPreferencesSoap[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 PortletPreferencesSoap[][] toSoapModels(
058                    PortletPreferences[][] models) {
059                    PortletPreferencesSoap[][] soapModels = null;
060    
061                    if (models.length > 0) {
062                            soapModels = new PortletPreferencesSoap[models.length][models[0].length];
063                    }
064                    else {
065                            soapModels = new PortletPreferencesSoap[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 PortletPreferencesSoap[] toSoapModels(
076                    List<PortletPreferences> models) {
077                    List<PortletPreferencesSoap> soapModels = new ArrayList<PortletPreferencesSoap>(models.size());
078    
079                    for (PortletPreferences model : models) {
080                            soapModels.add(toSoapModel(model));
081                    }
082    
083                    return soapModels.toArray(new PortletPreferencesSoap[soapModels.size()]);
084            }
085    
086            public PortletPreferencesSoap() {
087            }
088    
089            public long getPrimaryKey() {
090                    return _portletPreferencesId;
091            }
092    
093            public void setPrimaryKey(long pk) {
094                    setPortletPreferencesId(pk);
095            }
096    
097            public long getPortletPreferencesId() {
098                    return _portletPreferencesId;
099            }
100    
101            public void setPortletPreferencesId(long portletPreferencesId) {
102                    _portletPreferencesId = portletPreferencesId;
103            }
104    
105            public long getOwnerId() {
106                    return _ownerId;
107            }
108    
109            public void setOwnerId(long ownerId) {
110                    _ownerId = ownerId;
111            }
112    
113            public int getOwnerType() {
114                    return _ownerType;
115            }
116    
117            public void setOwnerType(int ownerType) {
118                    _ownerType = ownerType;
119            }
120    
121            public long getPlid() {
122                    return _plid;
123            }
124    
125            public void setPlid(long plid) {
126                    _plid = plid;
127            }
128    
129            public String getPortletId() {
130                    return _portletId;
131            }
132    
133            public void setPortletId(String portletId) {
134                    _portletId = portletId;
135            }
136    
137            public String getPreferences() {
138                    return _preferences;
139            }
140    
141            public void setPreferences(String preferences) {
142                    _preferences = preferences;
143            }
144    
145            private long _portletPreferencesId;
146            private long _ownerId;
147            private int _ownerType;
148            private long _plid;
149            private String _portletId;
150            private String _preferences;
151    }