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.expando.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 ExpandoValue}.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see ExpandoValue
032     * @generated
033     */
034    @ProviderType
035    public class ExpandoValueWrapper implements ExpandoValue,
036            ModelWrapper<ExpandoValue> {
037            public ExpandoValueWrapper(ExpandoValue expandoValue) {
038                    _expandoValue = expandoValue;
039            }
040    
041            @Override
042            public Class<?> getModelClass() {
043                    return ExpandoValue.class;
044            }
045    
046            @Override
047            public String getModelClassName() {
048                    return ExpandoValue.class.getName();
049            }
050    
051            @Override
052            public Map<String, Object> getModelAttributes() {
053                    Map<String, Object> attributes = new HashMap<String, Object>();
054    
055                    attributes.put("valueId", getValueId());
056                    attributes.put("companyId", getCompanyId());
057                    attributes.put("tableId", getTableId());
058                    attributes.put("columnId", getColumnId());
059                    attributes.put("rowId", getRowId());
060                    attributes.put("classNameId", getClassNameId());
061                    attributes.put("classPK", getClassPK());
062                    attributes.put("data", getData());
063    
064                    return attributes;
065            }
066    
067            @Override
068            public void setModelAttributes(Map<String, Object> attributes) {
069                    Long valueId = (Long)attributes.get("valueId");
070    
071                    if (valueId != null) {
072                            setValueId(valueId);
073                    }
074    
075                    Long companyId = (Long)attributes.get("companyId");
076    
077                    if (companyId != null) {
078                            setCompanyId(companyId);
079                    }
080    
081                    Long tableId = (Long)attributes.get("tableId");
082    
083                    if (tableId != null) {
084                            setTableId(tableId);
085                    }
086    
087                    Long columnId = (Long)attributes.get("columnId");
088    
089                    if (columnId != null) {
090                            setColumnId(columnId);
091                    }
092    
093                    Long rowId = (Long)attributes.get("rowId");
094    
095                    if (rowId != null) {
096                            setRowId(rowId);
097                    }
098    
099                    Long classNameId = (Long)attributes.get("classNameId");
100    
101                    if (classNameId != null) {
102                            setClassNameId(classNameId);
103                    }
104    
105                    Long classPK = (Long)attributes.get("classPK");
106    
107                    if (classPK != null) {
108                            setClassPK(classPK);
109                    }
110    
111                    String data = (String)attributes.get("data");
112    
113                    if (data != null) {
114                            setData(data);
115                    }
116            }
117    
118            /**
119            * Returns the primary key of this expando value.
120            *
121            * @return the primary key of this expando value
122            */
123            @Override
124            public long getPrimaryKey() {
125                    return _expandoValue.getPrimaryKey();
126            }
127    
128            /**
129            * Sets the primary key of this expando value.
130            *
131            * @param primaryKey the primary key of this expando value
132            */
133            @Override
134            public void setPrimaryKey(long primaryKey) {
135                    _expandoValue.setPrimaryKey(primaryKey);
136            }
137    
138            /**
139            * Returns the value ID of this expando value.
140            *
141            * @return the value ID of this expando value
142            */
143            @Override
144            public long getValueId() {
145                    return _expandoValue.getValueId();
146            }
147    
148            /**
149            * Sets the value ID of this expando value.
150            *
151            * @param valueId the value ID of this expando value
152            */
153            @Override
154            public void setValueId(long valueId) {
155                    _expandoValue.setValueId(valueId);
156            }
157    
158            /**
159            * Returns the company ID of this expando value.
160            *
161            * @return the company ID of this expando value
162            */
163            @Override
164            public long getCompanyId() {
165                    return _expandoValue.getCompanyId();
166            }
167    
168            /**
169            * Sets the company ID of this expando value.
170            *
171            * @param companyId the company ID of this expando value
172            */
173            @Override
174            public void setCompanyId(long companyId) {
175                    _expandoValue.setCompanyId(companyId);
176            }
177    
178            /**
179            * Returns the table ID of this expando value.
180            *
181            * @return the table ID of this expando value
182            */
183            @Override
184            public long getTableId() {
185                    return _expandoValue.getTableId();
186            }
187    
188            /**
189            * Sets the table ID of this expando value.
190            *
191            * @param tableId the table ID of this expando value
192            */
193            @Override
194            public void setTableId(long tableId) {
195                    _expandoValue.setTableId(tableId);
196            }
197    
198            /**
199            * Returns the column ID of this expando value.
200            *
201            * @return the column ID of this expando value
202            */
203            @Override
204            public long getColumnId() {
205                    return _expandoValue.getColumnId();
206            }
207    
208            /**
209            * Sets the column ID of this expando value.
210            *
211            * @param columnId the column ID of this expando value
212            */
213            @Override
214            public void setColumnId(long columnId) {
215                    _expandoValue.setColumnId(columnId);
216            }
217    
218            /**
219            * Returns the row ID of this expando value.
220            *
221            * @return the row ID of this expando value
222            */
223            @Override
224            public long getRowId() {
225                    return _expandoValue.getRowId();
226            }
227    
228            /**
229            * Sets the row ID of this expando value.
230            *
231            * @param rowId the row ID of this expando value
232            */
233            @Override
234            public void setRowId(long rowId) {
235                    _expandoValue.setRowId(rowId);
236            }
237    
238            /**
239            * Returns the fully qualified class name of this expando value.
240            *
241            * @return the fully qualified class name of this expando value
242            */
243            @Override
244            public java.lang.String getClassName() {
245                    return _expandoValue.getClassName();
246            }
247    
248            @Override
249            public void setClassName(java.lang.String className) {
250                    _expandoValue.setClassName(className);
251            }
252    
253            /**
254            * Returns the class name ID of this expando value.
255            *
256            * @return the class name ID of this expando value
257            */
258            @Override
259            public long getClassNameId() {
260                    return _expandoValue.getClassNameId();
261            }
262    
263            /**
264            * Sets the class name ID of this expando value.
265            *
266            * @param classNameId the class name ID of this expando value
267            */
268            @Override
269            public void setClassNameId(long classNameId) {
270                    _expandoValue.setClassNameId(classNameId);
271            }
272    
273            /**
274            * Returns the class p k of this expando value.
275            *
276            * @return the class p k of this expando value
277            */
278            @Override
279            public long getClassPK() {
280                    return _expandoValue.getClassPK();
281            }
282    
283            /**
284            * Sets the class p k of this expando value.
285            *
286            * @param classPK the class p k of this expando value
287            */
288            @Override
289            public void setClassPK(long classPK) {
290                    _expandoValue.setClassPK(classPK);
291            }
292    
293            /**
294            * Returns the data of this expando value.
295            *
296            * @return the data of this expando value
297            */
298            @Override
299            public java.lang.String getData() {
300                    return _expandoValue.getData();
301            }
302    
303            /**
304            * Sets the data of this expando value.
305            *
306            * @param data the data of this expando value
307            */
308            @Override
309            public void setData(java.lang.String data) {
310                    _expandoValue.setData(data);
311            }
312    
313            @Override
314            public boolean isNew() {
315                    return _expandoValue.isNew();
316            }
317    
318            @Override
319            public void setNew(boolean n) {
320                    _expandoValue.setNew(n);
321            }
322    
323            @Override
324            public boolean isCachedModel() {
325                    return _expandoValue.isCachedModel();
326            }
327    
328            @Override
329            public void setCachedModel(boolean cachedModel) {
330                    _expandoValue.setCachedModel(cachedModel);
331            }
332    
333            @Override
334            public boolean isEscapedModel() {
335                    return _expandoValue.isEscapedModel();
336            }
337    
338            @Override
339            public java.io.Serializable getPrimaryKeyObj() {
340                    return _expandoValue.getPrimaryKeyObj();
341            }
342    
343            @Override
344            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
345                    _expandoValue.setPrimaryKeyObj(primaryKeyObj);
346            }
347    
348            @Override
349            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
350                    return _expandoValue.getExpandoBridge();
351            }
352    
353            @Override
354            public void setExpandoBridgeAttributes(
355                    com.liferay.portal.model.BaseModel<?> baseModel) {
356                    _expandoValue.setExpandoBridgeAttributes(baseModel);
357            }
358    
359            @Override
360            public void setExpandoBridgeAttributes(
361                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
362                    _expandoValue.setExpandoBridgeAttributes(expandoBridge);
363            }
364    
365            @Override
366            public void setExpandoBridgeAttributes(
367                    com.liferay.portal.service.ServiceContext serviceContext) {
368                    _expandoValue.setExpandoBridgeAttributes(serviceContext);
369            }
370    
371            @Override
372            public java.lang.Object clone() {
373                    return new ExpandoValueWrapper((ExpandoValue)_expandoValue.clone());
374            }
375    
376            @Override
377            public int compareTo(
378                    com.liferay.portlet.expando.model.ExpandoValue expandoValue) {
379                    return _expandoValue.compareTo(expandoValue);
380            }
381    
382            @Override
383            public int hashCode() {
384                    return _expandoValue.hashCode();
385            }
386    
387            @Override
388            public com.liferay.portal.model.CacheModel<com.liferay.portlet.expando.model.ExpandoValue> toCacheModel() {
389                    return _expandoValue.toCacheModel();
390            }
391    
392            @Override
393            public com.liferay.portlet.expando.model.ExpandoValue toEscapedModel() {
394                    return new ExpandoValueWrapper(_expandoValue.toEscapedModel());
395            }
396    
397            @Override
398            public com.liferay.portlet.expando.model.ExpandoValue toUnescapedModel() {
399                    return new ExpandoValueWrapper(_expandoValue.toUnescapedModel());
400            }
401    
402            @Override
403            public java.lang.String toString() {
404                    return _expandoValue.toString();
405            }
406    
407            @Override
408            public java.lang.String toXmlString() {
409                    return _expandoValue.toXmlString();
410            }
411    
412            @Override
413            public void persist()
414                    throws com.liferay.portal.kernel.exception.SystemException {
415                    _expandoValue.persist();
416            }
417    
418            @Override
419            public java.util.List<java.util.Locale> getAvailableLocales()
420                    throws com.liferay.portal.kernel.exception.PortalException,
421                            com.liferay.portal.kernel.exception.SystemException {
422                    return _expandoValue.getAvailableLocales();
423            }
424    
425            @Override
426            public boolean getBoolean()
427                    throws com.liferay.portal.kernel.exception.PortalException,
428                            com.liferay.portal.kernel.exception.SystemException {
429                    return _expandoValue.getBoolean();
430            }
431    
432            @Override
433            public boolean[] getBooleanArray()
434                    throws com.liferay.portal.kernel.exception.PortalException,
435                            com.liferay.portal.kernel.exception.SystemException {
436                    return _expandoValue.getBooleanArray();
437            }
438    
439            @Override
440            public com.liferay.portlet.expando.model.ExpandoColumn getColumn()
441                    throws com.liferay.portal.kernel.exception.PortalException,
442                            com.liferay.portal.kernel.exception.SystemException {
443                    return _expandoValue.getColumn();
444            }
445    
446            @Override
447            public java.util.Date getDate()
448                    throws com.liferay.portal.kernel.exception.PortalException,
449                            com.liferay.portal.kernel.exception.SystemException {
450                    return _expandoValue.getDate();
451            }
452    
453            @Override
454            public java.util.Date[] getDateArray()
455                    throws com.liferay.portal.kernel.exception.PortalException,
456                            com.liferay.portal.kernel.exception.SystemException {
457                    return _expandoValue.getDateArray();
458            }
459    
460            @Override
461            public java.util.Locale getDefaultLocale()
462                    throws com.liferay.portal.kernel.exception.PortalException,
463                            com.liferay.portal.kernel.exception.SystemException {
464                    return _expandoValue.getDefaultLocale();
465            }
466    
467            @Override
468            public double getDouble()
469                    throws com.liferay.portal.kernel.exception.PortalException,
470                            com.liferay.portal.kernel.exception.SystemException {
471                    return _expandoValue.getDouble();
472            }
473    
474            @Override
475            public double[] getDoubleArray()
476                    throws com.liferay.portal.kernel.exception.PortalException,
477                            com.liferay.portal.kernel.exception.SystemException {
478                    return _expandoValue.getDoubleArray();
479            }
480    
481            @Override
482            public float getFloat()
483                    throws com.liferay.portal.kernel.exception.PortalException,
484                            com.liferay.portal.kernel.exception.SystemException {
485                    return _expandoValue.getFloat();
486            }
487    
488            @Override
489            public float[] getFloatArray()
490                    throws com.liferay.portal.kernel.exception.PortalException,
491                            com.liferay.portal.kernel.exception.SystemException {
492                    return _expandoValue.getFloatArray();
493            }
494    
495            @Override
496            public int getInteger()
497                    throws com.liferay.portal.kernel.exception.PortalException,
498                            com.liferay.portal.kernel.exception.SystemException {
499                    return _expandoValue.getInteger();
500            }
501    
502            @Override
503            public int[] getIntegerArray()
504                    throws com.liferay.portal.kernel.exception.PortalException,
505                            com.liferay.portal.kernel.exception.SystemException {
506                    return _expandoValue.getIntegerArray();
507            }
508    
509            @Override
510            public long getLong()
511                    throws com.liferay.portal.kernel.exception.PortalException,
512                            com.liferay.portal.kernel.exception.SystemException {
513                    return _expandoValue.getLong();
514            }
515    
516            @Override
517            public long[] getLongArray()
518                    throws com.liferay.portal.kernel.exception.PortalException,
519                            com.liferay.portal.kernel.exception.SystemException {
520                    return _expandoValue.getLongArray();
521            }
522    
523            @Override
524            public java.lang.Number getNumber()
525                    throws com.liferay.portal.kernel.exception.PortalException,
526                            com.liferay.portal.kernel.exception.SystemException {
527                    return _expandoValue.getNumber();
528            }
529    
530            @Override
531            public java.lang.Number[] getNumberArray()
532                    throws com.liferay.portal.kernel.exception.PortalException,
533                            com.liferay.portal.kernel.exception.SystemException {
534                    return _expandoValue.getNumberArray();
535            }
536    
537            @Override
538            public java.io.Serializable getSerializable()
539                    throws com.liferay.portal.kernel.exception.PortalException,
540                            com.liferay.portal.kernel.exception.SystemException {
541                    return _expandoValue.getSerializable();
542            }
543    
544            @Override
545            public short getShort()
546                    throws com.liferay.portal.kernel.exception.PortalException,
547                            com.liferay.portal.kernel.exception.SystemException {
548                    return _expandoValue.getShort();
549            }
550    
551            @Override
552            public short[] getShortArray()
553                    throws com.liferay.portal.kernel.exception.PortalException,
554                            com.liferay.portal.kernel.exception.SystemException {
555                    return _expandoValue.getShortArray();
556            }
557    
558            @Override
559            public java.lang.String getString()
560                    throws com.liferay.portal.kernel.exception.PortalException,
561                            com.liferay.portal.kernel.exception.SystemException {
562                    return _expandoValue.getString();
563            }
564    
565            @Override
566            public java.lang.String getString(java.util.Locale locale)
567                    throws com.liferay.portal.kernel.exception.PortalException,
568                            com.liferay.portal.kernel.exception.SystemException {
569                    return _expandoValue.getString(locale);
570            }
571    
572            @Override
573            public java.lang.String[] getStringArray()
574                    throws com.liferay.portal.kernel.exception.PortalException,
575                            com.liferay.portal.kernel.exception.SystemException {
576                    return _expandoValue.getStringArray();
577            }
578    
579            @Override
580            public java.lang.String[] getStringArray(java.util.Locale locale)
581                    throws com.liferay.portal.kernel.exception.PortalException,
582                            com.liferay.portal.kernel.exception.SystemException {
583                    return _expandoValue.getStringArray(locale);
584            }
585    
586            @Override
587            public java.util.Map<java.util.Locale, java.lang.String[]> getStringArrayMap()
588                    throws com.liferay.portal.kernel.exception.PortalException,
589                            com.liferay.portal.kernel.exception.SystemException {
590                    return _expandoValue.getStringArrayMap();
591            }
592    
593            @Override
594            public java.util.Map<java.util.Locale, java.lang.String> getStringMap()
595                    throws com.liferay.portal.kernel.exception.PortalException,
596                            com.liferay.portal.kernel.exception.SystemException {
597                    return _expandoValue.getStringMap();
598            }
599    
600            @Override
601            public void setBoolean(boolean data)
602                    throws com.liferay.portal.kernel.exception.PortalException,
603                            com.liferay.portal.kernel.exception.SystemException {
604                    _expandoValue.setBoolean(data);
605            }
606    
607            @Override
608            public void setBooleanArray(boolean[] data)
609                    throws com.liferay.portal.kernel.exception.PortalException,
610                            com.liferay.portal.kernel.exception.SystemException {
611                    _expandoValue.setBooleanArray(data);
612            }
613    
614            @Override
615            public void setColumn(
616                    com.liferay.portlet.expando.model.ExpandoColumn column) {
617                    _expandoValue.setColumn(column);
618            }
619    
620            @Override
621            public void setDate(java.util.Date data)
622                    throws com.liferay.portal.kernel.exception.PortalException,
623                            com.liferay.portal.kernel.exception.SystemException {
624                    _expandoValue.setDate(data);
625            }
626    
627            @Override
628            public void setDateArray(java.util.Date[] data)
629                    throws com.liferay.portal.kernel.exception.PortalException,
630                            com.liferay.portal.kernel.exception.SystemException {
631                    _expandoValue.setDateArray(data);
632            }
633    
634            @Override
635            public void setDouble(double data)
636                    throws com.liferay.portal.kernel.exception.PortalException,
637                            com.liferay.portal.kernel.exception.SystemException {
638                    _expandoValue.setDouble(data);
639            }
640    
641            @Override
642            public void setDoubleArray(double[] data)
643                    throws com.liferay.portal.kernel.exception.PortalException,
644                            com.liferay.portal.kernel.exception.SystemException {
645                    _expandoValue.setDoubleArray(data);
646            }
647    
648            @Override
649            public void setFloat(float data)
650                    throws com.liferay.portal.kernel.exception.PortalException,
651                            com.liferay.portal.kernel.exception.SystemException {
652                    _expandoValue.setFloat(data);
653            }
654    
655            @Override
656            public void setFloatArray(float[] data)
657                    throws com.liferay.portal.kernel.exception.PortalException,
658                            com.liferay.portal.kernel.exception.SystemException {
659                    _expandoValue.setFloatArray(data);
660            }
661    
662            @Override
663            public void setInteger(int data)
664                    throws com.liferay.portal.kernel.exception.PortalException,
665                            com.liferay.portal.kernel.exception.SystemException {
666                    _expandoValue.setInteger(data);
667            }
668    
669            @Override
670            public void setIntegerArray(int[] data)
671                    throws com.liferay.portal.kernel.exception.PortalException,
672                            com.liferay.portal.kernel.exception.SystemException {
673                    _expandoValue.setIntegerArray(data);
674            }
675    
676            @Override
677            public void setLong(long data)
678                    throws com.liferay.portal.kernel.exception.PortalException,
679                            com.liferay.portal.kernel.exception.SystemException {
680                    _expandoValue.setLong(data);
681            }
682    
683            @Override
684            public void setLongArray(long[] data)
685                    throws com.liferay.portal.kernel.exception.PortalException,
686                            com.liferay.portal.kernel.exception.SystemException {
687                    _expandoValue.setLongArray(data);
688            }
689    
690            @Override
691            public void setNumber(java.lang.Number data)
692                    throws com.liferay.portal.kernel.exception.PortalException,
693                            com.liferay.portal.kernel.exception.SystemException {
694                    _expandoValue.setNumber(data);
695            }
696    
697            @Override
698            public void setNumberArray(java.lang.Number[] data)
699                    throws com.liferay.portal.kernel.exception.PortalException,
700                            com.liferay.portal.kernel.exception.SystemException {
701                    _expandoValue.setNumberArray(data);
702            }
703    
704            @Override
705            public void setShort(short data)
706                    throws com.liferay.portal.kernel.exception.PortalException,
707                            com.liferay.portal.kernel.exception.SystemException {
708                    _expandoValue.setShort(data);
709            }
710    
711            @Override
712            public void setShortArray(short[] data)
713                    throws com.liferay.portal.kernel.exception.PortalException,
714                            com.liferay.portal.kernel.exception.SystemException {
715                    _expandoValue.setShortArray(data);
716            }
717    
718            @Override
719            public void setString(java.lang.String data)
720                    throws com.liferay.portal.kernel.exception.PortalException,
721                            com.liferay.portal.kernel.exception.SystemException {
722                    _expandoValue.setString(data);
723            }
724    
725            @Override
726            public void setString(java.lang.String data, java.util.Locale locale,
727                    java.util.Locale defaultLocale)
728                    throws com.liferay.portal.kernel.exception.PortalException,
729                            com.liferay.portal.kernel.exception.SystemException {
730                    _expandoValue.setString(data, locale, defaultLocale);
731            }
732    
733            @Override
734            public void setStringArray(java.lang.String[] data)
735                    throws com.liferay.portal.kernel.exception.PortalException,
736                            com.liferay.portal.kernel.exception.SystemException {
737                    _expandoValue.setStringArray(data);
738            }
739    
740            @Override
741            public void setStringArray(java.lang.String[] data,
742                    java.util.Locale locale, java.util.Locale defaultLocale)
743                    throws com.liferay.portal.kernel.exception.PortalException,
744                            com.liferay.portal.kernel.exception.SystemException {
745                    _expandoValue.setStringArray(data, locale, defaultLocale);
746            }
747    
748            @Override
749            public void setStringArrayMap(
750                    java.util.Map<java.util.Locale, java.lang.String[]> dataMap,
751                    java.util.Locale defaultLocale)
752                    throws com.liferay.portal.kernel.exception.PortalException,
753                            com.liferay.portal.kernel.exception.SystemException {
754                    _expandoValue.setStringArrayMap(dataMap, defaultLocale);
755            }
756    
757            @Override
758            public void setStringMap(
759                    java.util.Map<java.util.Locale, java.lang.String> dataMap,
760                    java.util.Locale defaultLocale)
761                    throws com.liferay.portal.kernel.exception.PortalException,
762                            com.liferay.portal.kernel.exception.SystemException {
763                    _expandoValue.setStringMap(dataMap, defaultLocale);
764            }
765    
766            @Override
767            public boolean equals(Object obj) {
768                    if (this == obj) {
769                            return true;
770                    }
771    
772                    if (!(obj instanceof ExpandoValueWrapper)) {
773                            return false;
774                    }
775    
776                    ExpandoValueWrapper expandoValueWrapper = (ExpandoValueWrapper)obj;
777    
778                    if (Validator.equals(_expandoValue, expandoValueWrapper._expandoValue)) {
779                            return true;
780                    }
781    
782                    return false;
783            }
784    
785            /**
786             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
787             */
788            public ExpandoValue getWrappedExpandoValue() {
789                    return _expandoValue;
790            }
791    
792            @Override
793            public ExpandoValue getWrappedModel() {
794                    return _expandoValue;
795            }
796    
797            @Override
798            public void resetOriginalValues() {
799                    _expandoValue.resetOriginalValues();
800            }
801    
802            private ExpandoValue _expandoValue;
803    }