001    /**
002     * Copyright (c) 2000-present 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.kernel.model;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.expando.kernel.model.ExpandoBridge;
020    
021    import com.liferay.portal.kernel.model.ModelWrapper;
022    import com.liferay.portal.kernel.service.ServiceContext;
023    
024    import java.io.Serializable;
025    
026    import java.util.HashMap;
027    import java.util.Map;
028    import java.util.Objects;
029    
030    /**
031     * <p>
032     * This class is a wrapper for {@link Counter}.
033     * </p>
034     *
035     * @author Brian Wing Shun Chan
036     * @see Counter
037     * @generated
038     */
039    @ProviderType
040    public class CounterWrapper implements Counter, ModelWrapper<Counter> {
041            public CounterWrapper(Counter counter) {
042                    _counter = counter;
043            }
044    
045            @Override
046            public Class<?> getModelClass() {
047                    return Counter.class;
048            }
049    
050            @Override
051            public String getModelClassName() {
052                    return Counter.class.getName();
053            }
054    
055            @Override
056            public Map<String, Object> getModelAttributes() {
057                    Map<String, Object> attributes = new HashMap<String, Object>();
058    
059                    attributes.put("name", getName());
060                    attributes.put("currentId", getCurrentId());
061    
062                    return attributes;
063            }
064    
065            @Override
066            public void setModelAttributes(Map<String, Object> attributes) {
067                    String name = (String)attributes.get("name");
068    
069                    if (name != null) {
070                            setName(name);
071                    }
072    
073                    Long currentId = (Long)attributes.get("currentId");
074    
075                    if (currentId != null) {
076                            setCurrentId(currentId);
077                    }
078            }
079    
080            @Override
081            public Counter toEscapedModel() {
082                    return new CounterWrapper(_counter.toEscapedModel());
083            }
084    
085            @Override
086            public Counter toUnescapedModel() {
087                    return new CounterWrapper(_counter.toUnescapedModel());
088            }
089    
090            @Override
091            public boolean isCachedModel() {
092                    return _counter.isCachedModel();
093            }
094    
095            @Override
096            public boolean isEscapedModel() {
097                    return _counter.isEscapedModel();
098            }
099    
100            @Override
101            public boolean isNew() {
102                    return _counter.isNew();
103            }
104    
105            @Override
106            public ExpandoBridge getExpandoBridge() {
107                    return _counter.getExpandoBridge();
108            }
109    
110            @Override
111            public com.liferay.portal.kernel.model.CacheModel<Counter> toCacheModel() {
112                    return _counter.toCacheModel();
113            }
114    
115            @Override
116            public int compareTo(Counter counter) {
117                    return _counter.compareTo(counter);
118            }
119    
120            @Override
121            public int hashCode() {
122                    return _counter.hashCode();
123            }
124    
125            @Override
126            public Serializable getPrimaryKeyObj() {
127                    return _counter.getPrimaryKeyObj();
128            }
129    
130            @Override
131            public java.lang.Object clone() {
132                    return new CounterWrapper((Counter)_counter.clone());
133            }
134    
135            /**
136            * Returns the name of this counter.
137            *
138            * @return the name of this counter
139            */
140            @Override
141            public java.lang.String getName() {
142                    return _counter.getName();
143            }
144    
145            /**
146            * Returns the primary key of this counter.
147            *
148            * @return the primary key of this counter
149            */
150            @Override
151            public java.lang.String getPrimaryKey() {
152                    return _counter.getPrimaryKey();
153            }
154    
155            @Override
156            public java.lang.String toString() {
157                    return _counter.toString();
158            }
159    
160            @Override
161            public java.lang.String toXmlString() {
162                    return _counter.toXmlString();
163            }
164    
165            /**
166            * Returns the current ID of this counter.
167            *
168            * @return the current ID of this counter
169            */
170            @Override
171            public long getCurrentId() {
172                    return _counter.getCurrentId();
173            }
174    
175            @Override
176            public void persist() {
177                    _counter.persist();
178            }
179    
180            @Override
181            public void setCachedModel(boolean cachedModel) {
182                    _counter.setCachedModel(cachedModel);
183            }
184    
185            /**
186            * Sets the current ID of this counter.
187            *
188            * @param currentId the current ID of this counter
189            */
190            @Override
191            public void setCurrentId(long currentId) {
192                    _counter.setCurrentId(currentId);
193            }
194    
195            @Override
196            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
197                    _counter.setExpandoBridgeAttributes(expandoBridge);
198            }
199    
200            @Override
201            public void setExpandoBridgeAttributes(
202                    com.liferay.portal.kernel.model.BaseModel<?> baseModel) {
203                    _counter.setExpandoBridgeAttributes(baseModel);
204            }
205    
206            @Override
207            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
208                    _counter.setExpandoBridgeAttributes(serviceContext);
209            }
210    
211            /**
212            * Sets the name of this counter.
213            *
214            * @param name the name of this counter
215            */
216            @Override
217            public void setName(java.lang.String name) {
218                    _counter.setName(name);
219            }
220    
221            @Override
222            public void setNew(boolean n) {
223                    _counter.setNew(n);
224            }
225    
226            /**
227            * Sets the primary key of this counter.
228            *
229            * @param primaryKey the primary key of this counter
230            */
231            @Override
232            public void setPrimaryKey(java.lang.String primaryKey) {
233                    _counter.setPrimaryKey(primaryKey);
234            }
235    
236            @Override
237            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
238                    _counter.setPrimaryKeyObj(primaryKeyObj);
239            }
240    
241            @Override
242            public boolean equals(Object obj) {
243                    if (this == obj) {
244                            return true;
245                    }
246    
247                    if (!(obj instanceof CounterWrapper)) {
248                            return false;
249                    }
250    
251                    CounterWrapper counterWrapper = (CounterWrapper)obj;
252    
253                    if (Objects.equals(_counter, counterWrapper._counter)) {
254                            return true;
255                    }
256    
257                    return false;
258            }
259    
260            @Override
261            public Counter getWrappedModel() {
262                    return _counter;
263            }
264    
265            @Override
266            public boolean isEntityCacheEnabled() {
267                    return _counter.isEntityCacheEnabled();
268            }
269    
270            @Override
271            public boolean isFinderCacheEnabled() {
272                    return _counter.isFinderCacheEnabled();
273            }
274    
275            @Override
276            public void resetOriginalValues() {
277                    _counter.resetOriginalValues();
278            }
279    
280            private final Counter _counter;
281    }