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.impl;
016    
017    import com.liferay.portal.kernel.util.StringBundler;
018    import com.liferay.portal.kernel.util.StringPool;
019    import com.liferay.portal.model.CacheModel;
020    import com.liferay.portal.model.UserIdMapper;
021    
022    import java.io.Serializable;
023    
024    /**
025     * The cache model class for representing UserIdMapper in entity cache.
026     *
027     * @author Brian Wing Shun Chan
028     * @see UserIdMapper
029     * @generated
030     */
031    public class UserIdMapperCacheModel implements CacheModel<UserIdMapper>,
032            Serializable {
033            @Override
034            public String toString() {
035                    StringBundler sb = new StringBundler(11);
036    
037                    sb.append("{userIdMapperId=");
038                    sb.append(userIdMapperId);
039                    sb.append(", userId=");
040                    sb.append(userId);
041                    sb.append(", type=");
042                    sb.append(type);
043                    sb.append(", description=");
044                    sb.append(description);
045                    sb.append(", externalUserId=");
046                    sb.append(externalUserId);
047                    sb.append("}");
048    
049                    return sb.toString();
050            }
051    
052            public UserIdMapper toEntityModel() {
053                    UserIdMapperImpl userIdMapperImpl = new UserIdMapperImpl();
054    
055                    userIdMapperImpl.setUserIdMapperId(userIdMapperId);
056                    userIdMapperImpl.setUserId(userId);
057    
058                    if (type == null) {
059                            userIdMapperImpl.setType(StringPool.BLANK);
060                    }
061                    else {
062                            userIdMapperImpl.setType(type);
063                    }
064    
065                    if (description == null) {
066                            userIdMapperImpl.setDescription(StringPool.BLANK);
067                    }
068                    else {
069                            userIdMapperImpl.setDescription(description);
070                    }
071    
072                    if (externalUserId == null) {
073                            userIdMapperImpl.setExternalUserId(StringPool.BLANK);
074                    }
075                    else {
076                            userIdMapperImpl.setExternalUserId(externalUserId);
077                    }
078    
079                    userIdMapperImpl.resetOriginalValues();
080    
081                    return userIdMapperImpl;
082            }
083    
084            public long userIdMapperId;
085            public long userId;
086            public String type;
087            public String description;
088            public String externalUserId;
089    }