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    
043                    return soapModel;
044            }
045    
046            public static UserGroupRoleSoap[] toSoapModels(UserGroupRole[] models) {
047                    UserGroupRoleSoap[] soapModels = new UserGroupRoleSoap[models.length];
048    
049                    for (int i = 0; i < models.length; i++) {
050                            soapModels[i] = toSoapModel(models[i]);
051                    }
052    
053                    return soapModels;
054            }
055    
056            public static UserGroupRoleSoap[][] toSoapModels(UserGroupRole[][] models) {
057                    UserGroupRoleSoap[][] soapModels = null;
058    
059                    if (models.length > 0) {
060                            soapModels = new UserGroupRoleSoap[models.length][models[0].length];
061                    }
062                    else {
063                            soapModels = new UserGroupRoleSoap[0][0];
064                    }
065    
066                    for (int i = 0; i < models.length; i++) {
067                            soapModels[i] = toSoapModels(models[i]);
068                    }
069    
070                    return soapModels;
071            }
072    
073            public static UserGroupRoleSoap[] toSoapModels(List<UserGroupRole> models) {
074                    List<UserGroupRoleSoap> soapModels = new ArrayList<UserGroupRoleSoap>(models.size());
075    
076                    for (UserGroupRole model : models) {
077                            soapModels.add(toSoapModel(model));
078                    }
079    
080                    return soapModels.toArray(new UserGroupRoleSoap[soapModels.size()]);
081            }
082    
083            public UserGroupRoleSoap() {
084            }
085    
086            public UserGroupRolePK getPrimaryKey() {
087                    return new UserGroupRolePK(_userId, _groupId, _roleId);
088            }
089    
090            public void setPrimaryKey(UserGroupRolePK pk) {
091                    setUserId(pk.userId);
092                    setGroupId(pk.groupId);
093                    setRoleId(pk.roleId);
094            }
095    
096            public long getMvccVersion() {
097                    return _mvccVersion;
098            }
099    
100            public void setMvccVersion(long mvccVersion) {
101                    _mvccVersion = mvccVersion;
102            }
103    
104            public long getUserId() {
105                    return _userId;
106            }
107    
108            public void setUserId(long userId) {
109                    _userId = userId;
110            }
111    
112            public long getGroupId() {
113                    return _groupId;
114            }
115    
116            public void setGroupId(long groupId) {
117                    _groupId = groupId;
118            }
119    
120            public long getRoleId() {
121                    return _roleId;
122            }
123    
124            public void setRoleId(long roleId) {
125                    _roleId = roleId;
126            }
127    
128            private long _mvccVersion;
129            private long _userId;
130            private long _groupId;
131            private long _roleId;
132    }