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