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.Shard;
021    
022    import java.io.Serializable;
023    
024    /**
025     * The cache model class for representing Shard in entity cache.
026     *
027     * @author Brian Wing Shun Chan
028     * @see Shard
029     * @generated
030     */
031    public class ShardCacheModel implements CacheModel<Shard>, Serializable {
032            @Override
033            public String toString() {
034                    StringBundler sb = new StringBundler(9);
035    
036                    sb.append("{shardId=");
037                    sb.append(shardId);
038                    sb.append(", classNameId=");
039                    sb.append(classNameId);
040                    sb.append(", classPK=");
041                    sb.append(classPK);
042                    sb.append(", name=");
043                    sb.append(name);
044                    sb.append("}");
045    
046                    return sb.toString();
047            }
048    
049            public Shard toEntityModel() {
050                    ShardImpl shardImpl = new ShardImpl();
051    
052                    shardImpl.setShardId(shardId);
053                    shardImpl.setClassNameId(classNameId);
054                    shardImpl.setClassPK(classPK);
055    
056                    if (name == null) {
057                            shardImpl.setName(StringPool.BLANK);
058                    }
059                    else {
060                            shardImpl.setName(name);
061                    }
062    
063                    shardImpl.resetOriginalValues();
064    
065                    return shardImpl;
066            }
067    
068            public long shardId;
069            public long classNameId;
070            public long classPK;
071            public String name;
072    }