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