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.RegionServiceSoap}.
024     *
025     * @author    Brian Wing Shun Chan
026     * @see       com.liferay.portal.service.http.RegionServiceSoap
027     * @generated
028     */
029    public class RegionSoap implements Serializable {
030            public static RegionSoap toSoapModel(Region model) {
031                    RegionSoap soapModel = new RegionSoap();
032    
033                    soapModel.setRegionId(model.getRegionId());
034                    soapModel.setCountryId(model.getCountryId());
035                    soapModel.setRegionCode(model.getRegionCode());
036                    soapModel.setName(model.getName());
037                    soapModel.setActive(model.getActive());
038    
039                    return soapModel;
040            }
041    
042            public static RegionSoap[] toSoapModels(Region[] models) {
043                    RegionSoap[] soapModels = new RegionSoap[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 RegionSoap[][] toSoapModels(Region[][] models) {
053                    RegionSoap[][] soapModels = null;
054    
055                    if (models.length > 0) {
056                            soapModels = new RegionSoap[models.length][models[0].length];
057                    }
058                    else {
059                            soapModels = new RegionSoap[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 RegionSoap[] toSoapModels(List<Region> models) {
070                    List<RegionSoap> soapModels = new ArrayList<RegionSoap>(models.size());
071    
072                    for (Region model : models) {
073                            soapModels.add(toSoapModel(model));
074                    }
075    
076                    return soapModels.toArray(new RegionSoap[soapModels.size()]);
077            }
078    
079            public RegionSoap() {
080            }
081    
082            public long getPrimaryKey() {
083                    return _regionId;
084            }
085    
086            public void setPrimaryKey(long pk) {
087                    setRegionId(pk);
088            }
089    
090            public long getRegionId() {
091                    return _regionId;
092            }
093    
094            public void setRegionId(long regionId) {
095                    _regionId = regionId;
096            }
097    
098            public long getCountryId() {
099                    return _countryId;
100            }
101    
102            public void setCountryId(long countryId) {
103                    _countryId = countryId;
104            }
105    
106            public String getRegionCode() {
107                    return _regionCode;
108            }
109    
110            public void setRegionCode(String regionCode) {
111                    _regionCode = regionCode;
112            }
113    
114            public String getName() {
115                    return _name;
116            }
117    
118            public void setName(String name) {
119                    _name = name;
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 _regionId;
135            private long _countryId;
136            private String _regionCode;
137            private String _name;
138            private boolean _active;
139    }