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.portlet.social.model;
016    
017    import com.liferay.portal.kernel.util.Validator;
018    import com.liferay.portal.model.ModelWrapper;
019    
020    import java.util.HashMap;
021    import java.util.Map;
022    
023    /**
024     * <p>
025     * This class is a wrapper for {@link SocialActivityCounter}.
026     * </p>
027     *
028     * @author    Brian Wing Shun Chan
029     * @see       SocialActivityCounter
030     * @generated
031     */
032    public class SocialActivityCounterWrapper implements SocialActivityCounter,
033            ModelWrapper<SocialActivityCounter> {
034            public SocialActivityCounterWrapper(
035                    SocialActivityCounter socialActivityCounter) {
036                    _socialActivityCounter = socialActivityCounter;
037            }
038    
039            public Class<?> getModelClass() {
040                    return SocialActivityCounter.class;
041            }
042    
043            public String getModelClassName() {
044                    return SocialActivityCounter.class.getName();
045            }
046    
047            public Map<String, Object> getModelAttributes() {
048                    Map<String, Object> attributes = new HashMap<String, Object>();
049    
050                    attributes.put("activityCounterId", getActivityCounterId());
051                    attributes.put("groupId", getGroupId());
052                    attributes.put("companyId", getCompanyId());
053                    attributes.put("classNameId", getClassNameId());
054                    attributes.put("classPK", getClassPK());
055                    attributes.put("name", getName());
056                    attributes.put("ownerType", getOwnerType());
057                    attributes.put("currentValue", getCurrentValue());
058                    attributes.put("totalValue", getTotalValue());
059                    attributes.put("graceValue", getGraceValue());
060                    attributes.put("startPeriod", getStartPeriod());
061                    attributes.put("endPeriod", getEndPeriod());
062    
063                    return attributes;
064            }
065    
066            public void setModelAttributes(Map<String, Object> attributes) {
067                    Long activityCounterId = (Long)attributes.get("activityCounterId");
068    
069                    if (activityCounterId != null) {
070                            setActivityCounterId(activityCounterId);
071                    }
072    
073                    Long groupId = (Long)attributes.get("groupId");
074    
075                    if (groupId != null) {
076                            setGroupId(groupId);
077                    }
078    
079                    Long companyId = (Long)attributes.get("companyId");
080    
081                    if (companyId != null) {
082                            setCompanyId(companyId);
083                    }
084    
085                    Long classNameId = (Long)attributes.get("classNameId");
086    
087                    if (classNameId != null) {
088                            setClassNameId(classNameId);
089                    }
090    
091                    Long classPK = (Long)attributes.get("classPK");
092    
093                    if (classPK != null) {
094                            setClassPK(classPK);
095                    }
096    
097                    String name = (String)attributes.get("name");
098    
099                    if (name != null) {
100                            setName(name);
101                    }
102    
103                    Integer ownerType = (Integer)attributes.get("ownerType");
104    
105                    if (ownerType != null) {
106                            setOwnerType(ownerType);
107                    }
108    
109                    Integer currentValue = (Integer)attributes.get("currentValue");
110    
111                    if (currentValue != null) {
112                            setCurrentValue(currentValue);
113                    }
114    
115                    Integer totalValue = (Integer)attributes.get("totalValue");
116    
117                    if (totalValue != null) {
118                            setTotalValue(totalValue);
119                    }
120    
121                    Integer graceValue = (Integer)attributes.get("graceValue");
122    
123                    if (graceValue != null) {
124                            setGraceValue(graceValue);
125                    }
126    
127                    Integer startPeriod = (Integer)attributes.get("startPeriod");
128    
129                    if (startPeriod != null) {
130                            setStartPeriod(startPeriod);
131                    }
132    
133                    Integer endPeriod = (Integer)attributes.get("endPeriod");
134    
135                    if (endPeriod != null) {
136                            setEndPeriod(endPeriod);
137                    }
138            }
139    
140            /**
141            * Returns the primary key of this social activity counter.
142            *
143            * @return the primary key of this social activity counter
144            */
145            public long getPrimaryKey() {
146                    return _socialActivityCounter.getPrimaryKey();
147            }
148    
149            /**
150            * Sets the primary key of this social activity counter.
151            *
152            * @param primaryKey the primary key of this social activity counter
153            */
154            public void setPrimaryKey(long primaryKey) {
155                    _socialActivityCounter.setPrimaryKey(primaryKey);
156            }
157    
158            /**
159            * Returns the activity counter ID of this social activity counter.
160            *
161            * @return the activity counter ID of this social activity counter
162            */
163            public long getActivityCounterId() {
164                    return _socialActivityCounter.getActivityCounterId();
165            }
166    
167            /**
168            * Sets the activity counter ID of this social activity counter.
169            *
170            * @param activityCounterId the activity counter ID of this social activity counter
171            */
172            public void setActivityCounterId(long activityCounterId) {
173                    _socialActivityCounter.setActivityCounterId(activityCounterId);
174            }
175    
176            /**
177            * Returns the group ID of this social activity counter.
178            *
179            * @return the group ID of this social activity counter
180            */
181            public long getGroupId() {
182                    return _socialActivityCounter.getGroupId();
183            }
184    
185            /**
186            * Sets the group ID of this social activity counter.
187            *
188            * @param groupId the group ID of this social activity counter
189            */
190            public void setGroupId(long groupId) {
191                    _socialActivityCounter.setGroupId(groupId);
192            }
193    
194            /**
195            * Returns the company ID of this social activity counter.
196            *
197            * @return the company ID of this social activity counter
198            */
199            public long getCompanyId() {
200                    return _socialActivityCounter.getCompanyId();
201            }
202    
203            /**
204            * Sets the company ID of this social activity counter.
205            *
206            * @param companyId the company ID of this social activity counter
207            */
208            public void setCompanyId(long companyId) {
209                    _socialActivityCounter.setCompanyId(companyId);
210            }
211    
212            /**
213            * Returns the fully qualified class name of this social activity counter.
214            *
215            * @return the fully qualified class name of this social activity counter
216            */
217            public java.lang.String getClassName() {
218                    return _socialActivityCounter.getClassName();
219            }
220    
221            public void setClassName(java.lang.String className) {
222                    _socialActivityCounter.setClassName(className);
223            }
224    
225            /**
226            * Returns the class name ID of this social activity counter.
227            *
228            * @return the class name ID of this social activity counter
229            */
230            public long getClassNameId() {
231                    return _socialActivityCounter.getClassNameId();
232            }
233    
234            /**
235            * Sets the class name ID of this social activity counter.
236            *
237            * @param classNameId the class name ID of this social activity counter
238            */
239            public void setClassNameId(long classNameId) {
240                    _socialActivityCounter.setClassNameId(classNameId);
241            }
242    
243            /**
244            * Returns the class p k of this social activity counter.
245            *
246            * @return the class p k of this social activity counter
247            */
248            public long getClassPK() {
249                    return _socialActivityCounter.getClassPK();
250            }
251    
252            /**
253            * Sets the class p k of this social activity counter.
254            *
255            * @param classPK the class p k of this social activity counter
256            */
257            public void setClassPK(long classPK) {
258                    _socialActivityCounter.setClassPK(classPK);
259            }
260    
261            /**
262            * Returns the name of this social activity counter.
263            *
264            * @return the name of this social activity counter
265            */
266            public java.lang.String getName() {
267                    return _socialActivityCounter.getName();
268            }
269    
270            /**
271            * Sets the name of this social activity counter.
272            *
273            * @param name the name of this social activity counter
274            */
275            public void setName(java.lang.String name) {
276                    _socialActivityCounter.setName(name);
277            }
278    
279            /**
280            * Returns the owner type of this social activity counter.
281            *
282            * @return the owner type of this social activity counter
283            */
284            public int getOwnerType() {
285                    return _socialActivityCounter.getOwnerType();
286            }
287    
288            /**
289            * Sets the owner type of this social activity counter.
290            *
291            * @param ownerType the owner type of this social activity counter
292            */
293            public void setOwnerType(int ownerType) {
294                    _socialActivityCounter.setOwnerType(ownerType);
295            }
296    
297            /**
298            * Returns the current value of this social activity counter.
299            *
300            * @return the current value of this social activity counter
301            */
302            public int getCurrentValue() {
303                    return _socialActivityCounter.getCurrentValue();
304            }
305    
306            /**
307            * Sets the current value of this social activity counter.
308            *
309            * @param currentValue the current value of this social activity counter
310            */
311            public void setCurrentValue(int currentValue) {
312                    _socialActivityCounter.setCurrentValue(currentValue);
313            }
314    
315            /**
316            * Returns the total value of this social activity counter.
317            *
318            * @return the total value of this social activity counter
319            */
320            public int getTotalValue() {
321                    return _socialActivityCounter.getTotalValue();
322            }
323    
324            /**
325            * Sets the total value of this social activity counter.
326            *
327            * @param totalValue the total value of this social activity counter
328            */
329            public void setTotalValue(int totalValue) {
330                    _socialActivityCounter.setTotalValue(totalValue);
331            }
332    
333            /**
334            * Returns the grace value of this social activity counter.
335            *
336            * @return the grace value of this social activity counter
337            */
338            public int getGraceValue() {
339                    return _socialActivityCounter.getGraceValue();
340            }
341    
342            /**
343            * Sets the grace value of this social activity counter.
344            *
345            * @param graceValue the grace value of this social activity counter
346            */
347            public void setGraceValue(int graceValue) {
348                    _socialActivityCounter.setGraceValue(graceValue);
349            }
350    
351            /**
352            * Returns the start period of this social activity counter.
353            *
354            * @return the start period of this social activity counter
355            */
356            public int getStartPeriod() {
357                    return _socialActivityCounter.getStartPeriod();
358            }
359    
360            /**
361            * Sets the start period of this social activity counter.
362            *
363            * @param startPeriod the start period of this social activity counter
364            */
365            public void setStartPeriod(int startPeriod) {
366                    _socialActivityCounter.setStartPeriod(startPeriod);
367            }
368    
369            /**
370            * Returns the end period of this social activity counter.
371            *
372            * @return the end period of this social activity counter
373            */
374            public int getEndPeriod() {
375                    return _socialActivityCounter.getEndPeriod();
376            }
377    
378            /**
379            * Sets the end period of this social activity counter.
380            *
381            * @param endPeriod the end period of this social activity counter
382            */
383            public void setEndPeriod(int endPeriod) {
384                    _socialActivityCounter.setEndPeriod(endPeriod);
385            }
386    
387            public boolean isNew() {
388                    return _socialActivityCounter.isNew();
389            }
390    
391            public void setNew(boolean n) {
392                    _socialActivityCounter.setNew(n);
393            }
394    
395            public boolean isCachedModel() {
396                    return _socialActivityCounter.isCachedModel();
397            }
398    
399            public void setCachedModel(boolean cachedModel) {
400                    _socialActivityCounter.setCachedModel(cachedModel);
401            }
402    
403            public boolean isEscapedModel() {
404                    return _socialActivityCounter.isEscapedModel();
405            }
406    
407            public java.io.Serializable getPrimaryKeyObj() {
408                    return _socialActivityCounter.getPrimaryKeyObj();
409            }
410    
411            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
412                    _socialActivityCounter.setPrimaryKeyObj(primaryKeyObj);
413            }
414    
415            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
416                    return _socialActivityCounter.getExpandoBridge();
417            }
418    
419            public void setExpandoBridgeAttributes(
420                    com.liferay.portal.service.ServiceContext serviceContext) {
421                    _socialActivityCounter.setExpandoBridgeAttributes(serviceContext);
422            }
423    
424            @Override
425            public java.lang.Object clone() {
426                    return new SocialActivityCounterWrapper((SocialActivityCounter)_socialActivityCounter.clone());
427            }
428    
429            public int compareTo(
430                    com.liferay.portlet.social.model.SocialActivityCounter socialActivityCounter) {
431                    return _socialActivityCounter.compareTo(socialActivityCounter);
432            }
433    
434            @Override
435            public int hashCode() {
436                    return _socialActivityCounter.hashCode();
437            }
438    
439            public com.liferay.portal.model.CacheModel<com.liferay.portlet.social.model.SocialActivityCounter> toCacheModel() {
440                    return _socialActivityCounter.toCacheModel();
441            }
442    
443            public com.liferay.portlet.social.model.SocialActivityCounter toEscapedModel() {
444                    return new SocialActivityCounterWrapper(_socialActivityCounter.toEscapedModel());
445            }
446    
447            public com.liferay.portlet.social.model.SocialActivityCounter toUnescapedModel() {
448                    return new SocialActivityCounterWrapper(_socialActivityCounter.toUnescapedModel());
449            }
450    
451            @Override
452            public java.lang.String toString() {
453                    return _socialActivityCounter.toString();
454            }
455    
456            public java.lang.String toXmlString() {
457                    return _socialActivityCounter.toXmlString();
458            }
459    
460            public void persist()
461                    throws com.liferay.portal.kernel.exception.SystemException {
462                    _socialActivityCounter.persist();
463            }
464    
465            public boolean isActivePeriod(int periodLength) {
466                    return _socialActivityCounter.isActivePeriod(periodLength);
467            }
468    
469            @Override
470            public boolean equals(Object obj) {
471                    if (this == obj) {
472                            return true;
473                    }
474    
475                    if (!(obj instanceof SocialActivityCounterWrapper)) {
476                            return false;
477                    }
478    
479                    SocialActivityCounterWrapper socialActivityCounterWrapper = (SocialActivityCounterWrapper)obj;
480    
481                    if (Validator.equals(_socialActivityCounter,
482                                            socialActivityCounterWrapper._socialActivityCounter)) {
483                            return true;
484                    }
485    
486                    return false;
487            }
488    
489            /**
490             * @deprecated Renamed to {@link #getWrappedModel}
491             */
492            public SocialActivityCounter getWrappedSocialActivityCounter() {
493                    return _socialActivityCounter;
494            }
495    
496            public SocialActivityCounter getWrappedModel() {
497                    return _socialActivityCounter;
498            }
499    
500            public void resetOriginalValues() {
501                    _socialActivityCounter.resetOriginalValues();
502            }
503    
504            private SocialActivityCounter _socialActivityCounter;
505    }