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.social.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 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 SocialActivityCounter toEscapedModel() {
161                    return new SocialActivityCounterWrapper(_socialActivityCounter.toEscapedModel());
162            }
163    
164            @Override
165            public SocialActivityCounter toUnescapedModel() {
166                    return new SocialActivityCounterWrapper(_socialActivityCounter.toUnescapedModel());
167            }
168    
169            /**
170            * Returns the active of this social activity counter.
171            *
172            * @return the active of this social activity counter
173            */
174            @Override
175            public boolean getActive() {
176                    return _socialActivityCounter.getActive();
177            }
178    
179            /**
180            * Returns <code>true</code> if this social activity counter is active.
181            *
182            * @return <code>true</code> if this social activity counter is active; <code>false</code> otherwise
183            */
184            @Override
185            public boolean isActive() {
186                    return _socialActivityCounter.isActive();
187            }
188    
189            @Override
190            public boolean isActivePeriod(int periodLength) {
191                    return _socialActivityCounter.isActivePeriod(periodLength);
192            }
193    
194            @Override
195            public boolean isCachedModel() {
196                    return _socialActivityCounter.isCachedModel();
197            }
198    
199            @Override
200            public boolean isEscapedModel() {
201                    return _socialActivityCounter.isEscapedModel();
202            }
203    
204            @Override
205            public boolean isNew() {
206                    return _socialActivityCounter.isNew();
207            }
208    
209            @Override
210            public ExpandoBridge getExpandoBridge() {
211                    return _socialActivityCounter.getExpandoBridge();
212            }
213    
214            @Override
215            public com.liferay.portal.kernel.model.CacheModel<SocialActivityCounter> toCacheModel() {
216                    return _socialActivityCounter.toCacheModel();
217            }
218    
219            @Override
220            public int compareTo(SocialActivityCounter socialActivityCounter) {
221                    return _socialActivityCounter.compareTo(socialActivityCounter);
222            }
223    
224            /**
225            * Returns the current value of this social activity counter.
226            *
227            * @return the current value of this social activity counter
228            */
229            @Override
230            public int getCurrentValue() {
231                    return _socialActivityCounter.getCurrentValue();
232            }
233    
234            /**
235            * Returns the end period of this social activity counter.
236            *
237            * @return the end period of this social activity counter
238            */
239            @Override
240            public int getEndPeriod() {
241                    return _socialActivityCounter.getEndPeriod();
242            }
243    
244            /**
245            * Returns the grace value of this social activity counter.
246            *
247            * @return the grace value of this social activity counter
248            */
249            @Override
250            public int getGraceValue() {
251                    return _socialActivityCounter.getGraceValue();
252            }
253    
254            /**
255            * Returns the owner type of this social activity counter.
256            *
257            * @return the owner type of this social activity counter
258            */
259            @Override
260            public int getOwnerType() {
261                    return _socialActivityCounter.getOwnerType();
262            }
263    
264            /**
265            * Returns the start period of this social activity counter.
266            *
267            * @return the start period of this social activity counter
268            */
269            @Override
270            public int getStartPeriod() {
271                    return _socialActivityCounter.getStartPeriod();
272            }
273    
274            /**
275            * Returns the total value of this social activity counter.
276            *
277            * @return the total value of this social activity counter
278            */
279            @Override
280            public int getTotalValue() {
281                    return _socialActivityCounter.getTotalValue();
282            }
283    
284            @Override
285            public int hashCode() {
286                    return _socialActivityCounter.hashCode();
287            }
288    
289            @Override
290            public Serializable getPrimaryKeyObj() {
291                    return _socialActivityCounter.getPrimaryKeyObj();
292            }
293    
294            @Override
295            public java.lang.Object clone() {
296                    return new SocialActivityCounterWrapper((SocialActivityCounter)_socialActivityCounter.clone());
297            }
298    
299            /**
300            * Returns the fully qualified class name of this social activity counter.
301            *
302            * @return the fully qualified class name of this social activity counter
303            */
304            @Override
305            public java.lang.String getClassName() {
306                    return _socialActivityCounter.getClassName();
307            }
308    
309            /**
310            * Returns the name of this social activity counter.
311            *
312            * @return the name of this social activity counter
313            */
314            @Override
315            public java.lang.String getName() {
316                    return _socialActivityCounter.getName();
317            }
318    
319            @Override
320            public java.lang.String toString() {
321                    return _socialActivityCounter.toString();
322            }
323    
324            @Override
325            public java.lang.String toXmlString() {
326                    return _socialActivityCounter.toXmlString();
327            }
328    
329            /**
330            * Returns the activity counter ID of this social activity counter.
331            *
332            * @return the activity counter ID of this social activity counter
333            */
334            @Override
335            public long getActivityCounterId() {
336                    return _socialActivityCounter.getActivityCounterId();
337            }
338    
339            /**
340            * Returns the class name ID of this social activity counter.
341            *
342            * @return the class name ID of this social activity counter
343            */
344            @Override
345            public long getClassNameId() {
346                    return _socialActivityCounter.getClassNameId();
347            }
348    
349            /**
350            * Returns the class p k of this social activity counter.
351            *
352            * @return the class p k of this social activity counter
353            */
354            @Override
355            public long getClassPK() {
356                    return _socialActivityCounter.getClassPK();
357            }
358    
359            /**
360            * Returns the company ID of this social activity counter.
361            *
362            * @return the company ID of this social activity counter
363            */
364            @Override
365            public long getCompanyId() {
366                    return _socialActivityCounter.getCompanyId();
367            }
368    
369            /**
370            * Returns the group ID of this social activity counter.
371            *
372            * @return the group ID of this social activity counter
373            */
374            @Override
375            public long getGroupId() {
376                    return _socialActivityCounter.getGroupId();
377            }
378    
379            /**
380            * Returns the primary key of this social activity counter.
381            *
382            * @return the primary key of this social activity counter
383            */
384            @Override
385            public long getPrimaryKey() {
386                    return _socialActivityCounter.getPrimaryKey();
387            }
388    
389            @Override
390            public void persist() {
391                    _socialActivityCounter.persist();
392            }
393    
394            /**
395            * Sets whether this social activity counter is active.
396            *
397            * @param active the active of this social activity counter
398            */
399            @Override
400            public void setActive(boolean active) {
401                    _socialActivityCounter.setActive(active);
402            }
403    
404            /**
405            * Sets the activity counter ID of this social activity counter.
406            *
407            * @param activityCounterId the activity counter ID of this social activity counter
408            */
409            @Override
410            public void setActivityCounterId(long activityCounterId) {
411                    _socialActivityCounter.setActivityCounterId(activityCounterId);
412            }
413    
414            @Override
415            public void setCachedModel(boolean cachedModel) {
416                    _socialActivityCounter.setCachedModel(cachedModel);
417            }
418    
419            @Override
420            public void setClassName(java.lang.String className) {
421                    _socialActivityCounter.setClassName(className);
422            }
423    
424            /**
425            * Sets the class name ID of this social activity counter.
426            *
427            * @param classNameId the class name ID of this social activity counter
428            */
429            @Override
430            public void setClassNameId(long classNameId) {
431                    _socialActivityCounter.setClassNameId(classNameId);
432            }
433    
434            /**
435            * Sets the class p k of this social activity counter.
436            *
437            * @param classPK the class p k of this social activity counter
438            */
439            @Override
440            public void setClassPK(long classPK) {
441                    _socialActivityCounter.setClassPK(classPK);
442            }
443    
444            /**
445            * Sets the company ID of this social activity counter.
446            *
447            * @param companyId the company ID of this social activity counter
448            */
449            @Override
450            public void setCompanyId(long companyId) {
451                    _socialActivityCounter.setCompanyId(companyId);
452            }
453    
454            /**
455            * Sets the current value of this social activity counter.
456            *
457            * @param currentValue the current value of this social activity counter
458            */
459            @Override
460            public void setCurrentValue(int currentValue) {
461                    _socialActivityCounter.setCurrentValue(currentValue);
462            }
463    
464            /**
465            * Sets the end period of this social activity counter.
466            *
467            * @param endPeriod the end period of this social activity counter
468            */
469            @Override
470            public void setEndPeriod(int endPeriod) {
471                    _socialActivityCounter.setEndPeriod(endPeriod);
472            }
473    
474            @Override
475            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
476                    _socialActivityCounter.setExpandoBridgeAttributes(expandoBridge);
477            }
478    
479            @Override
480            public void setExpandoBridgeAttributes(
481                    com.liferay.portal.kernel.model.BaseModel<?> baseModel) {
482                    _socialActivityCounter.setExpandoBridgeAttributes(baseModel);
483            }
484    
485            @Override
486            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
487                    _socialActivityCounter.setExpandoBridgeAttributes(serviceContext);
488            }
489    
490            /**
491            * Sets the grace value of this social activity counter.
492            *
493            * @param graceValue the grace value of this social activity counter
494            */
495            @Override
496            public void setGraceValue(int graceValue) {
497                    _socialActivityCounter.setGraceValue(graceValue);
498            }
499    
500            /**
501            * Sets the group ID of this social activity counter.
502            *
503            * @param groupId the group ID of this social activity counter
504            */
505            @Override
506            public void setGroupId(long groupId) {
507                    _socialActivityCounter.setGroupId(groupId);
508            }
509    
510            /**
511            * Sets the name of this social activity counter.
512            *
513            * @param name the name of this social activity counter
514            */
515            @Override
516            public void setName(java.lang.String name) {
517                    _socialActivityCounter.setName(name);
518            }
519    
520            @Override
521            public void setNew(boolean n) {
522                    _socialActivityCounter.setNew(n);
523            }
524    
525            /**
526            * Sets the owner type of this social activity counter.
527            *
528            * @param ownerType the owner type of this social activity counter
529            */
530            @Override
531            public void setOwnerType(int ownerType) {
532                    _socialActivityCounter.setOwnerType(ownerType);
533            }
534    
535            /**
536            * Sets the primary key of this social activity counter.
537            *
538            * @param primaryKey the primary key of this social activity counter
539            */
540            @Override
541            public void setPrimaryKey(long primaryKey) {
542                    _socialActivityCounter.setPrimaryKey(primaryKey);
543            }
544    
545            @Override
546            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
547                    _socialActivityCounter.setPrimaryKeyObj(primaryKeyObj);
548            }
549    
550            /**
551            * Sets the start period of this social activity counter.
552            *
553            * @param startPeriod the start period of this social activity counter
554            */
555            @Override
556            public void setStartPeriod(int startPeriod) {
557                    _socialActivityCounter.setStartPeriod(startPeriod);
558            }
559    
560            /**
561            * Sets the total value of this social activity counter.
562            *
563            * @param totalValue the total value of this social activity counter
564            */
565            @Override
566            public void setTotalValue(int totalValue) {
567                    _socialActivityCounter.setTotalValue(totalValue);
568            }
569    
570            @Override
571            public boolean equals(Object obj) {
572                    if (this == obj) {
573                            return true;
574                    }
575    
576                    if (!(obj instanceof SocialActivityCounterWrapper)) {
577                            return false;
578                    }
579    
580                    SocialActivityCounterWrapper socialActivityCounterWrapper = (SocialActivityCounterWrapper)obj;
581    
582                    if (Objects.equals(_socialActivityCounter,
583                                            socialActivityCounterWrapper._socialActivityCounter)) {
584                            return true;
585                    }
586    
587                    return false;
588            }
589    
590            @Override
591            public SocialActivityCounter getWrappedModel() {
592                    return _socialActivityCounter;
593            }
594    
595            @Override
596            public boolean isEntityCacheEnabled() {
597                    return _socialActivityCounter.isEntityCacheEnabled();
598            }
599    
600            @Override
601            public boolean isFinderCacheEnabled() {
602                    return _socialActivityCounter.isFinderCacheEnabled();
603            }
604    
605            @Override
606            public void resetOriginalValues() {
607                    _socialActivityCounter.resetOriginalValues();
608            }
609    
610            private final SocialActivityCounter _socialActivityCounter;
611    }