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