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.counter.model.impl;
016    
017    import com.liferay.counter.model.Counter;
018    
019    import com.liferay.portal.kernel.util.StringBundler;
020    import com.liferay.portal.kernel.util.StringPool;
021    import com.liferay.portal.model.CacheModel;
022    
023    import java.io.Serializable;
024    
025    /**
026     * The cache model class for representing Counter in entity cache.
027     *
028     * @author Brian Wing Shun Chan
029     * @see Counter
030     * @generated
031     */
032    public class CounterCacheModel implements CacheModel<Counter>, Serializable {
033            @Override
034            public String toString() {
035                    StringBundler sb = new StringBundler(5);
036    
037                    sb.append("{name=");
038                    sb.append(name);
039                    sb.append(", currentId=");
040                    sb.append(currentId);
041                    sb.append("}");
042    
043                    return sb.toString();
044            }
045    
046            public Counter toEntityModel() {
047                    CounterImpl counterImpl = new CounterImpl();
048    
049                    if (name == null) {
050                            counterImpl.setName(StringPool.BLANK);
051                    }
052                    else {
053                            counterImpl.setName(name);
054                    }
055    
056                    counterImpl.setCurrentId(currentId);
057    
058                    counterImpl.resetOriginalValues();
059    
060                    return counterImpl;
061            }
062    
063            public String name;
064            public long currentId;
065    }