001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.service.persistence.UserGroupRolePK;
020    
021    import java.io.Serializable;
022    
023    import java.util.ArrayList;
024    import java.util.List;
025    
026    /**
027     * This class is used by SOAP remote services, specifically {@link com.liferay.portal.service.http.UserGroupRoleServiceSoap}.
028     *
029     * @author Brian Wing Shun Chan
030     * @see com.liferay.portal.service.http.UserGroupRoleServiceSoap
031     * @generated
032     */
033    @ProviderType
034    public class UserGroupRoleSoap implements Serializable {
035            public static UserGroupRoleSoap toSoapModel(UserGroupRole model) {
036                    UserGroupRoleSoap soapModel = new UserGroupRoleSoap();
037    
038                    soapModel.setMvccVersion(model.getMvccVersion());
039                    soapModel.setUserId(model.getUserId());
040                    soapModel.setGroupId(model.getGroupId());
041                    soapModel.setRoleId(model.getRoleId());
042                    soapModel.setCompanyId(model.getCompanyId());
043    
044                    return soapModel;
045            }
046    
047            public static UserGroupRoleSoap[] toSoapModels(UserGroupRole[] models) {
048                    UserGroupRoleSoap[] soapModels = new UserGroupRoleSoap[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 UserGroupRoleSoap[][] toSoapModels(UserGroupRole[][] models) {
058                    UserGroupRoleSoap[][] soapModels = null;
059    
060                    if (models.length > 0) {
061                            soapModels = new UserGroupRoleSoap[models.length][models[0].length];
062                    }
063                    else {
064                            soapModels = new UserGroupRoleSoap[0][0];
065                    }
066    
067                    for (int i = 0; i < models.length; i++) {
068                            soapModels[i] = toSoapModels(models[i]);
069                    }
070    
071                    return soapModels;
072            }
073    
074            public static UserGroupRoleSoap[] toSoapModels(List<UserGroupRole> models) {
075                    List<UserGroupRoleSoap> soapModels = new ArrayList<UserGroupRoleSoap>(models.size());
076    
077                    for (UserGroupRole model : models) {
078                            soapModels.add(toSoapModel(model));
079                    }
080    
081                    return soapModels.toArray(new UserGroupRoleSoap[soapModels.size()]);
082            }
083    
084            public UserGroupRoleSoap() {
085            }
086    
087            public UserGroupRolePK getPrimaryKey() {
088                    return new UserGroupRolePK(_userId, _groupId, _roleId);
089            }
090    
091            public void setPrimaryKey(UserGroupRolePK pk) {
092                    setUserId(pk.userId);
093                    setGroupId(pk.groupId);
094                    setRoleId(pk.roleId);
095            }
096    
097            public long getMvccVersion() {
098                    return _mvccVersion;
099            }
100    
101            public void setMvccVersion(long mvccVersion) {
102                    _mvccVersion = mvccVersion;
103            }
104    
105            public long getUserId() {
106                    return _userId;
107            }
108    
109            public void setUserId(long userId) {
110                    _userId = userId;
111            }
112    
113            public long getGroupId() {
114                    return _groupId;
115            }
116    
117            public void setGroupId(long groupId) {
118                    _groupId = groupId;
119            }
120    
121            public long getRoleId() {
122                    return _roleId;
123            }
124    
125            public void setRoleId(long roleId) {
126                    _roleId = roleId;
127            }
128    
129            public long getCompanyId() {
130                    return _companyId;
131            }
132    
133            public void setCompanyId(long companyId) {
134                    _companyId = companyId;
135            }
136    
137            private long _mvccVersion;
138            private long _userId;
139            private long _groupId;
140            private long _roleId;
141            private long _companyId;
142    }