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