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;
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.model.BaseModel<?> baseModel) {
155                    _counter.setExpandoBridgeAttributes(baseModel);
156            }
157    
158            public void setExpandoBridgeAttributes(
159                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
160                    _counter.setExpandoBridgeAttributes(expandoBridge);
161            }
162    
163            public void setExpandoBridgeAttributes(
164                    com.liferay.portal.service.ServiceContext serviceContext) {
165                    _counter.setExpandoBridgeAttributes(serviceContext);
166            }
167    
168            @Override
169            public java.lang.Object clone() {
170                    return new CounterWrapper((Counter)_counter.clone());
171            }
172    
173            public int compareTo(com.liferay.counter.model.Counter counter) {
174                    return _counter.compareTo(counter);
175            }
176    
177            @Override
178            public int hashCode() {
179                    return _counter.hashCode();
180            }
181    
182            public com.liferay.portal.model.CacheModel<com.liferay.counter.model.Counter> toCacheModel() {
183                    return _counter.toCacheModel();
184            }
185    
186            public com.liferay.counter.model.Counter toEscapedModel() {
187                    return new CounterWrapper(_counter.toEscapedModel());
188            }
189    
190            public com.liferay.counter.model.Counter toUnescapedModel() {
191                    return new CounterWrapper(_counter.toUnescapedModel());
192            }
193    
194            @Override
195            public java.lang.String toString() {
196                    return _counter.toString();
197            }
198    
199            public java.lang.String toXmlString() {
200                    return _counter.toXmlString();
201            }
202    
203            public void persist()
204                    throws com.liferay.portal.kernel.exception.SystemException {
205                    _counter.persist();
206            }
207    
208            /**
209             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
210             */
211            public Counter getWrappedCounter() {
212                    return _counter;
213            }
214    
215            public Counter getWrappedModel() {
216                    return _counter;
217            }
218    
219            public void resetOriginalValues() {
220                    _counter.resetOriginalValues();
221            }
222    
223            private Counter _counter;
224    }