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.ResourceServiceSoap}.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       com.liferay.portal.service.http.ResourceServiceSoap
030     * @generated
031     */
032    public class ResourceSoap implements Serializable {
033            public static ResourceSoap toSoapModel(Resource model) {
034                    ResourceSoap soapModel = new ResourceSoap();
035    
036                    soapModel.setResourceId(model.getResourceId());
037                    soapModel.setCodeId(model.getCodeId());
038                    soapModel.setPrimKey(model.getPrimKey());
039    
040                    return soapModel;
041            }
042    
043            public static ResourceSoap[] toSoapModels(Resource[] models) {
044                    ResourceSoap[] soapModels = new ResourceSoap[models.length];
045    
046                    for (int i = 0; i < models.length; i++) {
047                            soapModels[i] = toSoapModel(models[i]);
048                    }
049    
050                    return soapModels;
051            }
052    
053            public static ResourceSoap[][] toSoapModels(Resource[][] models) {
054                    ResourceSoap[][] soapModels = null;
055    
056                    if (models.length > 0) {
057                            soapModels = new ResourceSoap[models.length][models[0].length];
058                    }
059                    else {
060                            soapModels = new ResourceSoap[0][0];
061                    }
062    
063                    for (int i = 0; i < models.length; i++) {
064                            soapModels[i] = toSoapModels(models[i]);
065                    }
066    
067                    return soapModels;
068            }
069    
070            public static ResourceSoap[] toSoapModels(List<Resource> models) {
071                    List<ResourceSoap> soapModels = new ArrayList<ResourceSoap>(models.size());
072    
073                    for (Resource model : models) {
074                            soapModels.add(toSoapModel(model));
075                    }
076    
077                    return soapModels.toArray(new ResourceSoap[soapModels.size()]);
078            }
079    
080            public ResourceSoap() {
081            }
082    
083            public long getPrimaryKey() {
084                    return _resourceId;
085            }
086    
087            public void setPrimaryKey(long pk) {
088                    setResourceId(pk);
089            }
090    
091            public long getResourceId() {
092                    return _resourceId;
093            }
094    
095            public void setResourceId(long resourceId) {
096                    _resourceId = resourceId;
097            }
098    
099            public long getCodeId() {
100                    return _codeId;
101            }
102    
103            public void setCodeId(long codeId) {
104                    _codeId = codeId;
105            }
106    
107            public String getPrimKey() {
108                    return _primKey;
109            }
110    
111            public void setPrimKey(String primKey) {
112                    _primKey = primKey;
113            }
114    
115            private long _resourceId;
116            private long _codeId;
117            private String _primKey;
118    }