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 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     * <p>
026     * This class is used by
027     * {@link com.liferay.portal.service.http.UserGroupRoleServiceSoap}.
028     * </p>
029     *
030     * @author    Brian Wing Shun Chan
031     * @see       com.liferay.portal.service.http.UserGroupRoleServiceSoap
032     * @generated
033     */
034    public class UserGroupRoleSoap implements Serializable {
035            public static UserGroupRoleSoap toSoapModel(UserGroupRole model) {
036                    UserGroupRoleSoap soapModel = new UserGroupRoleSoap();
037    
038                    soapModel.setUserId(model.getUserId());
039                    soapModel.setGroupId(model.getGroupId());
040                    soapModel.setRoleId(model.getRoleId());
041    
042                    return soapModel;
043            }
044    
045            public static UserGroupRoleSoap[] toSoapModels(UserGroupRole[] models) {
046                    UserGroupRoleSoap[] soapModels = new UserGroupRoleSoap[models.length];
047    
048                    for (int i = 0; i < models.length; i++) {
049                            soapModels[i] = toSoapModel(models[i]);
050                    }
051    
052                    return soapModels;
053            }
054    
055            public static UserGroupRoleSoap[][] toSoapModels(UserGroupRole[][] models) {
056                    UserGroupRoleSoap[][] soapModels = null;
057    
058                    if (models.length > 0) {
059                            soapModels = new UserGroupRoleSoap[models.length][models[0].length];
060                    }
061                    else {
062                            soapModels = new UserGroupRoleSoap[0][0];
063                    }
064    
065                    for (int i = 0; i < models.length; i++) {
066                            soapModels[i] = toSoapModels(models[i]);
067                    }
068    
069                    return soapModels;
070            }
071    
072            public static UserGroupRoleSoap[] toSoapModels(List<UserGroupRole> models) {
073                    List<UserGroupRoleSoap> soapModels = new ArrayList<UserGroupRoleSoap>(models.size());
074    
075                    for (UserGroupRole model : models) {
076                            soapModels.add(toSoapModel(model));
077                    }
078    
079                    return soapModels.toArray(new UserGroupRoleSoap[soapModels.size()]);
080            }
081    
082            public UserGroupRoleSoap() {
083            }
084    
085            public UserGroupRolePK getPrimaryKey() {
086                    return new UserGroupRolePK(_userId, _groupId, _roleId);
087            }
088    
089            public void setPrimaryKey(UserGroupRolePK pk) {
090                    setUserId(pk.userId);
091                    setGroupId(pk.groupId);
092                    setRoleId(pk.roleId);
093            }
094    
095            public long getUserId() {
096                    return _userId;
097            }
098    
099            public void setUserId(long userId) {
100                    _userId = userId;
101            }
102    
103            public long getGroupId() {
104                    return _groupId;
105            }
106    
107            public void setGroupId(long groupId) {
108                    _groupId = groupId;
109            }
110    
111            public long getRoleId() {
112                    return _roleId;
113            }
114    
115            public void setRoleId(long roleId) {
116                    _roleId = roleId;
117            }
118    
119            private long _userId;
120            private long _groupId;
121            private long _roleId;
122    }