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