001    /**
002     * Copyright (c) 2000-2012 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;
016    
017    import com.liferay.portal.model.ModelWrapper;
018    
019    import java.util.HashMap;
020    import java.util.Map;
021    
022    /**
023     * <p>
024     * This class is a wrapper for {@link Counter}.
025     * </p>
026     *
027     * @author    Brian Wing Shun Chan
028     * @see       Counter
029     * @generated
030     */
031    public class CounterWrapper implements Counter, ModelWrapper<Counter> {
032            public CounterWrapper(Counter counter) {
033                    _counter = counter;
034            }
035    
036            public Class<?> getModelClass() {
037                    return Counter.class;
038            }
039    
040            public String getModelClassName() {
041                    return Counter.class.getName();
042            }
043    
044            public Map<String, Object> getModelAttributes() {
045                    Map<String, Object> attributes = new HashMap<String, Object>();
046    
047                    attributes.put("name", getName());
048                    attributes.put("currentId", getCurrentId());
049    
050                    return attributes;
051            }
052    
053            public void setModelAttributes(Map<String, Object> attributes) {
054                    String name = (String)attributes.get("name");
055    
056                    if (name != null) {
057                            setName(name);
058                    }
059    
060                    Long currentId = (Long)attributes.get("currentId");
061    
062                    if (currentId != null) {
063                            setCurrentId(currentId);
064                    }
065            }
066    
067            /**
068            * Returns the primary key of this counter.
069            *
070            * @return the primary key of this counter
071            */
072            public java.lang.String getPrimaryKey() {
073                    return _counter.getPrimaryKey();
074            }
075    
076            /**
077            * Sets the primary key of this counter.
078            *
079            * @param primaryKey the primary key of this counter
080            */
081            public void setPrimaryKey(java.lang.String primaryKey) {
082                    _counter.setPrimaryKey(primaryKey);
083            }
084    
085            /**
086            * Returns the name of this counter.
087            *
088            * @return the name of this counter
089            */
090            public java.lang.String getName() {
091                    return _counter.getName();
092            }
093    
094            /**
095            * Sets the name of this counter.
096            *
097            * @param name the name of this counter
098            */
099            public void setName(java.lang.String name) {
100                    _counter.setName(name);
101            }
102    
103            /**
104            * Returns the current ID of this counter.
105            *
106            * @return the current ID of this counter
107            */
108            public long getCurrentId() {
109                    return _counter.getCurrentId();
110            }
111    
112            /**
113            * Sets the current ID of this counter.
114            *
115            * @param currentId the current ID of this counter
116            */
117            public void setCurrentId(long currentId) {
118                    _counter.setCurrentId(currentId);
119            }
120    
121            public boolean isNew() {
122                    return _counter.isNew();
123            }
124    
125            public void setNew(boolean n) {
126                    _counter.setNew(n);
127            }
128    
129            public boolean isCachedModel() {
130                    return _counter.isCachedModel();
131            }
132    
133            public void setCachedModel(boolean cachedModel) {
134                    _counter.setCachedModel(cachedModel);
135            }
136    
137            public boolean isEscapedModel() {
138                    return _counter.isEscapedModel();
139            }
140    
141            public java.io.Serializable getPrimaryKeyObj() {
142                    return _counter.getPrimaryKeyObj();
143            }
144    
145            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
146                    _counter.setPrimaryKeyObj(primaryKeyObj);
147            }
148    
149            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
150                    return _counter.getExpandoBridge();
151            }
152    
153            public void setExpandoBridgeAttributes(
154                    com.liferay.portal.service.ServiceContext serviceContext) {
155                    _counter.setExpandoBridgeAttributes(serviceContext);
156            }
157    
158            @Override
159            public java.lang.Object clone() {
160                    return new CounterWrapper((Counter)_counter.clone());
161            }
162    
163            public int compareTo(com.liferay.counter.model.Counter counter) {
164                    return _counter.compareTo(counter);
165            }
166    
167            @Override
168            public int hashCode() {
169                    return _counter.hashCode();
170            }
171    
172            public com.liferay.portal.model.CacheModel<com.liferay.counter.model.Counter> toCacheModel() {
173                    return _counter.toCacheModel();
174            }
175    
176            public com.liferay.counter.model.Counter toEscapedModel() {
177                    return new CounterWrapper(_counter.toEscapedModel());
178            }
179    
180            @Override
181            public java.lang.String toString() {
182                    return _counter.toString();
183            }
184    
185            public java.lang.String toXmlString() {
186                    return _counter.toXmlString();
187            }
188    
189            public void persist()
190                    throws com.liferay.portal.kernel.exception.SystemException {
191                    _counter.persist();
192            }
193    
194            /**
195             * @deprecated Renamed to {@link #getWrappedModel}
196             */
197            public Counter getWrappedCounter() {
198                    return _counter;
199            }
200    
201            public Counter getWrappedModel() {
202                    return _counter;
203            }
204    
205            public void resetOriginalValues() {
206                    _counter.resetOriginalValues();
207            }
208    
209            private Counter _counter;
210    }