001
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
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 }