001
014
015 package com.liferay.portlet.expando.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
032 public class ExpandoValueWrapper implements ExpandoValue,
033 ModelWrapper<ExpandoValue> {
034 public ExpandoValueWrapper(ExpandoValue expandoValue) {
035 _expandoValue = expandoValue;
036 }
037
038 public Class<?> getModelClass() {
039 return ExpandoValue.class;
040 }
041
042 public String getModelClassName() {
043 return ExpandoValue.class.getName();
044 }
045
046 public Map<String, Object> getModelAttributes() {
047 Map<String, Object> attributes = new HashMap<String, Object>();
048
049 attributes.put("valueId", getValueId());
050 attributes.put("companyId", getCompanyId());
051 attributes.put("tableId", getTableId());
052 attributes.put("columnId", getColumnId());
053 attributes.put("rowId", getRowId());
054 attributes.put("classNameId", getClassNameId());
055 attributes.put("classPK", getClassPK());
056 attributes.put("data", getData());
057
058 return attributes;
059 }
060
061 public void setModelAttributes(Map<String, Object> attributes) {
062 Long valueId = (Long)attributes.get("valueId");
063
064 if (valueId != null) {
065 setValueId(valueId);
066 }
067
068 Long companyId = (Long)attributes.get("companyId");
069
070 if (companyId != null) {
071 setCompanyId(companyId);
072 }
073
074 Long tableId = (Long)attributes.get("tableId");
075
076 if (tableId != null) {
077 setTableId(tableId);
078 }
079
080 Long columnId = (Long)attributes.get("columnId");
081
082 if (columnId != null) {
083 setColumnId(columnId);
084 }
085
086 Long rowId = (Long)attributes.get("rowId");
087
088 if (rowId != null) {
089 setRowId(rowId);
090 }
091
092 Long classNameId = (Long)attributes.get("classNameId");
093
094 if (classNameId != null) {
095 setClassNameId(classNameId);
096 }
097
098 Long classPK = (Long)attributes.get("classPK");
099
100 if (classPK != null) {
101 setClassPK(classPK);
102 }
103
104 String data = (String)attributes.get("data");
105
106 if (data != null) {
107 setData(data);
108 }
109 }
110
111
116 public long getPrimaryKey() {
117 return _expandoValue.getPrimaryKey();
118 }
119
120
125 public void setPrimaryKey(long primaryKey) {
126 _expandoValue.setPrimaryKey(primaryKey);
127 }
128
129
134 public long getValueId() {
135 return _expandoValue.getValueId();
136 }
137
138
143 public void setValueId(long valueId) {
144 _expandoValue.setValueId(valueId);
145 }
146
147
152 public long getCompanyId() {
153 return _expandoValue.getCompanyId();
154 }
155
156
161 public void setCompanyId(long companyId) {
162 _expandoValue.setCompanyId(companyId);
163 }
164
165
170 public long getTableId() {
171 return _expandoValue.getTableId();
172 }
173
174
179 public void setTableId(long tableId) {
180 _expandoValue.setTableId(tableId);
181 }
182
183
188 public long getColumnId() {
189 return _expandoValue.getColumnId();
190 }
191
192
197 public void setColumnId(long columnId) {
198 _expandoValue.setColumnId(columnId);
199 }
200
201
206 public long getRowId() {
207 return _expandoValue.getRowId();
208 }
209
210
215 public void setRowId(long rowId) {
216 _expandoValue.setRowId(rowId);
217 }
218
219
224 public java.lang.String getClassName() {
225 return _expandoValue.getClassName();
226 }
227
228 public void setClassName(java.lang.String className) {
229 _expandoValue.setClassName(className);
230 }
231
232
237 public long getClassNameId() {
238 return _expandoValue.getClassNameId();
239 }
240
241
246 public void setClassNameId(long classNameId) {
247 _expandoValue.setClassNameId(classNameId);
248 }
249
250
255 public long getClassPK() {
256 return _expandoValue.getClassPK();
257 }
258
259
264 public void setClassPK(long classPK) {
265 _expandoValue.setClassPK(classPK);
266 }
267
268
273 public java.lang.String getData() {
274 return _expandoValue.getData();
275 }
276
277
282 public void setData(java.lang.String data) {
283 _expandoValue.setData(data);
284 }
285
286 public boolean isNew() {
287 return _expandoValue.isNew();
288 }
289
290 public void setNew(boolean n) {
291 _expandoValue.setNew(n);
292 }
293
294 public boolean isCachedModel() {
295 return _expandoValue.isCachedModel();
296 }
297
298 public void setCachedModel(boolean cachedModel) {
299 _expandoValue.setCachedModel(cachedModel);
300 }
301
302 public boolean isEscapedModel() {
303 return _expandoValue.isEscapedModel();
304 }
305
306 public java.io.Serializable getPrimaryKeyObj() {
307 return _expandoValue.getPrimaryKeyObj();
308 }
309
310 public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
311 _expandoValue.setPrimaryKeyObj(primaryKeyObj);
312 }
313
314 public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
315 return _expandoValue.getExpandoBridge();
316 }
317
318 public void setExpandoBridgeAttributes(
319 com.liferay.portal.service.ServiceContext serviceContext) {
320 _expandoValue.setExpandoBridgeAttributes(serviceContext);
321 }
322
323 @Override
324 public java.lang.Object clone() {
325 return new ExpandoValueWrapper((ExpandoValue)_expandoValue.clone());
326 }
327
328 public int compareTo(
329 com.liferay.portlet.expando.model.ExpandoValue expandoValue) {
330 return _expandoValue.compareTo(expandoValue);
331 }
332
333 @Override
334 public int hashCode() {
335 return _expandoValue.hashCode();
336 }
337
338 public com.liferay.portal.model.CacheModel<com.liferay.portlet.expando.model.ExpandoValue> toCacheModel() {
339 return _expandoValue.toCacheModel();
340 }
341
342 public com.liferay.portlet.expando.model.ExpandoValue toEscapedModel() {
343 return new ExpandoValueWrapper(_expandoValue.toEscapedModel());
344 }
345
346 public com.liferay.portlet.expando.model.ExpandoValue toUnescapedModel() {
347 return new ExpandoValueWrapper(_expandoValue.toUnescapedModel());
348 }
349
350 @Override
351 public java.lang.String toString() {
352 return _expandoValue.toString();
353 }
354
355 public java.lang.String toXmlString() {
356 return _expandoValue.toXmlString();
357 }
358
359 public void persist()
360 throws com.liferay.portal.kernel.exception.SystemException {
361 _expandoValue.persist();
362 }
363
364 public boolean getBoolean()
365 throws com.liferay.portal.kernel.exception.PortalException,
366 com.liferay.portal.kernel.exception.SystemException {
367 return _expandoValue.getBoolean();
368 }
369
370 public boolean[] getBooleanArray()
371 throws com.liferay.portal.kernel.exception.PortalException,
372 com.liferay.portal.kernel.exception.SystemException {
373 return _expandoValue.getBooleanArray();
374 }
375
376 public com.liferay.portlet.expando.model.ExpandoColumn getColumn()
377 throws com.liferay.portal.kernel.exception.PortalException,
378 com.liferay.portal.kernel.exception.SystemException {
379 return _expandoValue.getColumn();
380 }
381
382 public java.util.Date getDate()
383 throws com.liferay.portal.kernel.exception.PortalException,
384 com.liferay.portal.kernel.exception.SystemException {
385 return _expandoValue.getDate();
386 }
387
388 public java.util.Date[] getDateArray()
389 throws com.liferay.portal.kernel.exception.PortalException,
390 com.liferay.portal.kernel.exception.SystemException {
391 return _expandoValue.getDateArray();
392 }
393
394 public double getDouble()
395 throws com.liferay.portal.kernel.exception.PortalException,
396 com.liferay.portal.kernel.exception.SystemException {
397 return _expandoValue.getDouble();
398 }
399
400 public double[] getDoubleArray()
401 throws com.liferay.portal.kernel.exception.PortalException,
402 com.liferay.portal.kernel.exception.SystemException {
403 return _expandoValue.getDoubleArray();
404 }
405
406 public float getFloat()
407 throws com.liferay.portal.kernel.exception.PortalException,
408 com.liferay.portal.kernel.exception.SystemException {
409 return _expandoValue.getFloat();
410 }
411
412 public float[] getFloatArray()
413 throws com.liferay.portal.kernel.exception.PortalException,
414 com.liferay.portal.kernel.exception.SystemException {
415 return _expandoValue.getFloatArray();
416 }
417
418 public int getInteger()
419 throws com.liferay.portal.kernel.exception.PortalException,
420 com.liferay.portal.kernel.exception.SystemException {
421 return _expandoValue.getInteger();
422 }
423
424 public int[] getIntegerArray()
425 throws com.liferay.portal.kernel.exception.PortalException,
426 com.liferay.portal.kernel.exception.SystemException {
427 return _expandoValue.getIntegerArray();
428 }
429
430 public long getLong()
431 throws com.liferay.portal.kernel.exception.PortalException,
432 com.liferay.portal.kernel.exception.SystemException {
433 return _expandoValue.getLong();
434 }
435
436 public long[] getLongArray()
437 throws com.liferay.portal.kernel.exception.PortalException,
438 com.liferay.portal.kernel.exception.SystemException {
439 return _expandoValue.getLongArray();
440 }
441
442 public java.lang.Number getNumber()
443 throws com.liferay.portal.kernel.exception.PortalException,
444 com.liferay.portal.kernel.exception.SystemException {
445 return _expandoValue.getNumber();
446 }
447
448 public java.lang.Number[] getNumberArray()
449 throws com.liferay.portal.kernel.exception.PortalException,
450 com.liferay.portal.kernel.exception.SystemException {
451 return _expandoValue.getNumberArray();
452 }
453
454 public java.io.Serializable getSerializable()
455 throws com.liferay.portal.kernel.exception.PortalException,
456 com.liferay.portal.kernel.exception.SystemException {
457 return _expandoValue.getSerializable();
458 }
459
460 public short getShort()
461 throws com.liferay.portal.kernel.exception.PortalException,
462 com.liferay.portal.kernel.exception.SystemException {
463 return _expandoValue.getShort();
464 }
465
466 public short[] getShortArray()
467 throws com.liferay.portal.kernel.exception.PortalException,
468 com.liferay.portal.kernel.exception.SystemException {
469 return _expandoValue.getShortArray();
470 }
471
472 public java.lang.String getString()
473 throws com.liferay.portal.kernel.exception.PortalException,
474 com.liferay.portal.kernel.exception.SystemException {
475 return _expandoValue.getString();
476 }
477
478 public java.lang.String[] getStringArray()
479 throws com.liferay.portal.kernel.exception.PortalException,
480 com.liferay.portal.kernel.exception.SystemException {
481 return _expandoValue.getStringArray();
482 }
483
484 public void setBoolean(boolean data)
485 throws com.liferay.portal.kernel.exception.PortalException,
486 com.liferay.portal.kernel.exception.SystemException {
487 _expandoValue.setBoolean(data);
488 }
489
490 public void setBooleanArray(boolean[] data)
491 throws com.liferay.portal.kernel.exception.PortalException,
492 com.liferay.portal.kernel.exception.SystemException {
493 _expandoValue.setBooleanArray(data);
494 }
495
496 public void setColumn(
497 com.liferay.portlet.expando.model.ExpandoColumn column) {
498 _expandoValue.setColumn(column);
499 }
500
501 public void setDate(java.util.Date data)
502 throws com.liferay.portal.kernel.exception.PortalException,
503 com.liferay.portal.kernel.exception.SystemException {
504 _expandoValue.setDate(data);
505 }
506
507 public void setDateArray(java.util.Date[] data)
508 throws com.liferay.portal.kernel.exception.PortalException,
509 com.liferay.portal.kernel.exception.SystemException {
510 _expandoValue.setDateArray(data);
511 }
512
513 public void setDouble(double data)
514 throws com.liferay.portal.kernel.exception.PortalException,
515 com.liferay.portal.kernel.exception.SystemException {
516 _expandoValue.setDouble(data);
517 }
518
519 public void setDoubleArray(double[] data)
520 throws com.liferay.portal.kernel.exception.PortalException,
521 com.liferay.portal.kernel.exception.SystemException {
522 _expandoValue.setDoubleArray(data);
523 }
524
525 public void setFloat(float data)
526 throws com.liferay.portal.kernel.exception.PortalException,
527 com.liferay.portal.kernel.exception.SystemException {
528 _expandoValue.setFloat(data);
529 }
530
531 public void setFloatArray(float[] data)
532 throws com.liferay.portal.kernel.exception.PortalException,
533 com.liferay.portal.kernel.exception.SystemException {
534 _expandoValue.setFloatArray(data);
535 }
536
537 public void setInteger(int data)
538 throws com.liferay.portal.kernel.exception.PortalException,
539 com.liferay.portal.kernel.exception.SystemException {
540 _expandoValue.setInteger(data);
541 }
542
543 public void setIntegerArray(int[] data)
544 throws com.liferay.portal.kernel.exception.PortalException,
545 com.liferay.portal.kernel.exception.SystemException {
546 _expandoValue.setIntegerArray(data);
547 }
548
549 public void setLong(long data)
550 throws com.liferay.portal.kernel.exception.PortalException,
551 com.liferay.portal.kernel.exception.SystemException {
552 _expandoValue.setLong(data);
553 }
554
555 public void setLongArray(long[] data)
556 throws com.liferay.portal.kernel.exception.PortalException,
557 com.liferay.portal.kernel.exception.SystemException {
558 _expandoValue.setLongArray(data);
559 }
560
561 public void setNumber(java.lang.Number data)
562 throws com.liferay.portal.kernel.exception.PortalException,
563 com.liferay.portal.kernel.exception.SystemException {
564 _expandoValue.setNumber(data);
565 }
566
567 public void setNumberArray(java.lang.Number[] data)
568 throws com.liferay.portal.kernel.exception.PortalException,
569 com.liferay.portal.kernel.exception.SystemException {
570 _expandoValue.setNumberArray(data);
571 }
572
573 public void setShort(short data)
574 throws com.liferay.portal.kernel.exception.PortalException,
575 com.liferay.portal.kernel.exception.SystemException {
576 _expandoValue.setShort(data);
577 }
578
579 public void setShortArray(short[] data)
580 throws com.liferay.portal.kernel.exception.PortalException,
581 com.liferay.portal.kernel.exception.SystemException {
582 _expandoValue.setShortArray(data);
583 }
584
585 public void setString(java.lang.String data)
586 throws com.liferay.portal.kernel.exception.PortalException,
587 com.liferay.portal.kernel.exception.SystemException {
588 _expandoValue.setString(data);
589 }
590
591 public void setStringArray(java.lang.String[] data)
592 throws com.liferay.portal.kernel.exception.PortalException,
593 com.liferay.portal.kernel.exception.SystemException {
594 _expandoValue.setStringArray(data);
595 }
596
597 @Override
598 public boolean equals(Object obj) {
599 if (this == obj) {
600 return true;
601 }
602
603 if (!(obj instanceof ExpandoValueWrapper)) {
604 return false;
605 }
606
607 ExpandoValueWrapper expandoValueWrapper = (ExpandoValueWrapper)obj;
608
609 if (Validator.equals(_expandoValue, expandoValueWrapper._expandoValue)) {
610 return true;
611 }
612
613 return false;
614 }
615
616
619 public ExpandoValue getWrappedExpandoValue() {
620 return _expandoValue;
621 }
622
623 public ExpandoValue getWrappedModel() {
624 return _expandoValue;
625 }
626
627 public void resetOriginalValues() {
628 _expandoValue.resetOriginalValues();
629 }
630
631 private ExpandoValue _expandoValue;
632 }