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 com.liferay.portal.service.persistence.UserGroupRolePK;
018    
019    import java.io.Serializable;
020    
021    import java.util.ArrayList;
022    import java.util.List;
023    
024    /**
025     * This class is used by SOAP remote services, specifically {@link com.liferay.portal.service.http.UserGroupRoleServiceSoap}.
026     *
027     * @author Brian Wing Shun Chan
028     * @see com.liferay.portal.service.http.UserGroupRoleServiceSoap
029     * @generated
030     */
031    public class UserGroupRoleSoap implements Serializable {
032            public static UserGroupRoleSoap toSoapModel(UserGroupRole model) {
033                    UserGroupRoleSoap soapModel = new UserGroupRoleSoap();
034    
035                    soapModel.setUserId(model.getUserId());
036                    soapModel.setGroupId(model.getGroupId());
037                    soapModel.setRoleId(model.getRoleId());
038    
039                    return soapModel;
040            }
041    
042            public static UserGroupRoleSoap[] toSoapModels(UserGroupRole[] models) {
043                    UserGroupRoleSoap[] soapModels = new UserGroupRoleSoap[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 UserGroupRoleSoap[][] toSoapModels(UserGroupRole[][] models) {
053                    UserGroupRoleSoap[][] soapModels = null;
054    
055                    if (models.length > 0) {
056                            soapModels = new UserGroupRoleSoap[models.length][models[0].length];
057                    }
058                    else {
059                            soapModels = new UserGroupRoleSoap[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 UserGroupRoleSoap[] toSoapModels(List<UserGroupRole> models) {
070                    List<UserGroupRoleSoap> soapModels = new ArrayList<UserGroupRoleSoap>(models.size());
071    
072                    for (UserGroupRole model : models) {
073                            soapModels.add(toSoapModel(model));
074                    }
075    
076                    return soapModels.toArray(new UserGroupRoleSoap[soapModels.size()]);
077            }
078    
079            public UserGroupRoleSoap() {
080            }
081    
082            public UserGroupRolePK getPrimaryKey() {
083                    return new UserGroupRolePK(_userId, _groupId, _roleId);
084            }
085    
086            public void setPrimaryKey(UserGroupRolePK pk) {
087                    setUserId(pk.userId);
088                    setGroupId(pk.groupId);
089                    setRoleId(pk.roleId);
090            }
091    
092            public long getUserId() {
093                    return _userId;
094            }
095    
096            public void setUserId(long userId) {
097                    _userId = userId;
098            }
099    
100            public long getGroupId() {
101                    return _groupId;
102            }
103    
104            public void setGroupId(long groupId) {
105                    _groupId = groupId;
106            }
107    
108            public long getRoleId() {
109                    return _roleId;
110            }
111    
112            public void setRoleId(long roleId) {
113                    _roleId = roleId;
114            }
115    
116            private long _userId;
117            private long _groupId;
118            private long _roleId;
119    }