001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.model;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.util.Validator;
020    
021    import java.util.Date;
022    import java.util.HashMap;
023    import java.util.Map;
024    
025    /**
026     * <p>
027     * This class is a wrapper for {@link Image}.
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see Image
032     * @generated
033     */
034    @ProviderType
035    public class ImageWrapper implements Image, ModelWrapper<Image> {
036            public ImageWrapper(Image image) {
037                    _image = image;
038            }
039    
040            @Override
041            public Class<?> getModelClass() {
042                    return Image.class;
043            }
044    
045            @Override
046            public String getModelClassName() {
047                    return Image.class.getName();
048            }
049    
050            @Override
051            public Map<String, Object> getModelAttributes() {
052                    Map<String, Object> attributes = new HashMap<String, Object>();
053    
054                    attributes.put("mvccVersion", getMvccVersion());
055                    attributes.put("imageId", getImageId());
056                    attributes.put("modifiedDate", getModifiedDate());
057                    attributes.put("type", getType());
058                    attributes.put("height", getHeight());
059                    attributes.put("width", getWidth());
060                    attributes.put("size", getSize());
061    
062                    return attributes;
063            }
064    
065            @Override
066            public void setModelAttributes(Map<String, Object> attributes) {
067                    Long mvccVersion = (Long)attributes.get("mvccVersion");
068    
069                    if (mvccVersion != null) {
070                            setMvccVersion(mvccVersion);
071                    }
072    
073                    Long imageId = (Long)attributes.get("imageId");
074    
075                    if (imageId != null) {
076                            setImageId(imageId);
077                    }
078    
079                    Date modifiedDate = (Date)attributes.get("modifiedDate");
080    
081                    if (modifiedDate != null) {
082                            setModifiedDate(modifiedDate);
083                    }
084    
085                    String type = (String)attributes.get("type");
086    
087                    if (type != null) {
088                            setType(type);
089                    }
090    
091                    Integer height = (Integer)attributes.get("height");
092    
093                    if (height != null) {
094                            setHeight(height);
095                    }
096    
097                    Integer width = (Integer)attributes.get("width");
098    
099                    if (width != null) {
100                            setWidth(width);
101                    }
102    
103                    Integer size = (Integer)attributes.get("size");
104    
105                    if (size != null) {
106                            setSize(size);
107                    }
108            }
109    
110            @Override
111            public java.lang.Object clone() {
112                    return new ImageWrapper((Image)_image.clone());
113            }
114    
115            @Override
116            public int compareTo(com.liferay.portal.model.Image image) {
117                    return _image.compareTo(image);
118            }
119    
120            @Override
121            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
122                    return _image.getExpandoBridge();
123            }
124    
125            /**
126            * Returns the height of this image.
127            *
128            * @return the height of this image
129            */
130            @Override
131            public int getHeight() {
132                    return _image.getHeight();
133            }
134    
135            /**
136            * Returns the image ID of this image.
137            *
138            * @return the image ID of this image
139            */
140            @Override
141            public long getImageId() {
142                    return _image.getImageId();
143            }
144    
145            /**
146            * Returns the modified date of this image.
147            *
148            * @return the modified date of this image
149            */
150            @Override
151            public Date getModifiedDate() {
152                    return _image.getModifiedDate();
153            }
154    
155            /**
156            * Returns the mvcc version of this image.
157            *
158            * @return the mvcc version of this image
159            */
160            @Override
161            public long getMvccVersion() {
162                    return _image.getMvccVersion();
163            }
164    
165            /**
166            * Returns the primary key of this image.
167            *
168            * @return the primary key of this image
169            */
170            @Override
171            public long getPrimaryKey() {
172                    return _image.getPrimaryKey();
173            }
174    
175            @Override
176            public java.io.Serializable getPrimaryKeyObj() {
177                    return _image.getPrimaryKeyObj();
178            }
179    
180            /**
181            * Returns the size of this image.
182            *
183            * @return the size of this image
184            */
185            @Override
186            public int getSize() {
187                    return _image.getSize();
188            }
189    
190            @Override
191            public byte[] getTextObj() {
192                    return _image.getTextObj();
193            }
194    
195            /**
196            * Returns the type of this image.
197            *
198            * @return the type of this image
199            */
200            @Override
201            public java.lang.String getType() {
202                    return _image.getType();
203            }
204    
205            /**
206            * Returns the width of this image.
207            *
208            * @return the width of this image
209            */
210            @Override
211            public int getWidth() {
212                    return _image.getWidth();
213            }
214    
215            @Override
216            public int hashCode() {
217                    return _image.hashCode();
218            }
219    
220            @Override
221            public boolean isCachedModel() {
222                    return _image.isCachedModel();
223            }
224    
225            @Override
226            public boolean isEscapedModel() {
227                    return _image.isEscapedModel();
228            }
229    
230            @Override
231            public boolean isNew() {
232                    return _image.isNew();
233            }
234    
235            @Override
236            public void persist() {
237                    _image.persist();
238            }
239    
240            @Override
241            public void setCachedModel(boolean cachedModel) {
242                    _image.setCachedModel(cachedModel);
243            }
244    
245            @Override
246            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
247                    _image.setExpandoBridgeAttributes(baseModel);
248            }
249    
250            @Override
251            public void setExpandoBridgeAttributes(
252                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
253                    _image.setExpandoBridgeAttributes(expandoBridge);
254            }
255    
256            @Override
257            public void setExpandoBridgeAttributes(
258                    com.liferay.portal.service.ServiceContext serviceContext) {
259                    _image.setExpandoBridgeAttributes(serviceContext);
260            }
261    
262            /**
263            * Sets the height of this image.
264            *
265            * @param height the height of this image
266            */
267            @Override
268            public void setHeight(int height) {
269                    _image.setHeight(height);
270            }
271    
272            /**
273            * Sets the image ID of this image.
274            *
275            * @param imageId the image ID of this image
276            */
277            @Override
278            public void setImageId(long imageId) {
279                    _image.setImageId(imageId);
280            }
281    
282            /**
283            * Sets the modified date of this image.
284            *
285            * @param modifiedDate the modified date of this image
286            */
287            @Override
288            public void setModifiedDate(Date modifiedDate) {
289                    _image.setModifiedDate(modifiedDate);
290            }
291    
292            /**
293            * Sets the mvcc version of this image.
294            *
295            * @param mvccVersion the mvcc version of this image
296            */
297            @Override
298            public void setMvccVersion(long mvccVersion) {
299                    _image.setMvccVersion(mvccVersion);
300            }
301    
302            @Override
303            public void setNew(boolean n) {
304                    _image.setNew(n);
305            }
306    
307            /**
308            * Sets the primary key of this image.
309            *
310            * @param primaryKey the primary key of this image
311            */
312            @Override
313            public void setPrimaryKey(long primaryKey) {
314                    _image.setPrimaryKey(primaryKey);
315            }
316    
317            @Override
318            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
319                    _image.setPrimaryKeyObj(primaryKeyObj);
320            }
321    
322            /**
323            * Sets the size of this image.
324            *
325            * @param size the size of this image
326            */
327            @Override
328            public void setSize(int size) {
329                    _image.setSize(size);
330            }
331    
332            @Override
333            public void setTextObj(byte[] textObj) {
334                    _image.setTextObj(textObj);
335            }
336    
337            /**
338            * Sets the type of this image.
339            *
340            * @param type the type of this image
341            */
342            @Override
343            public void setType(java.lang.String type) {
344                    _image.setType(type);
345            }
346    
347            /**
348            * Sets the width of this image.
349            *
350            * @param width the width of this image
351            */
352            @Override
353            public void setWidth(int width) {
354                    _image.setWidth(width);
355            }
356    
357            @Override
358            public CacheModel<com.liferay.portal.model.Image> toCacheModel() {
359                    return _image.toCacheModel();
360            }
361    
362            @Override
363            public com.liferay.portal.model.Image toEscapedModel() {
364                    return new ImageWrapper(_image.toEscapedModel());
365            }
366    
367            @Override
368            public java.lang.String toString() {
369                    return _image.toString();
370            }
371    
372            @Override
373            public com.liferay.portal.model.Image toUnescapedModel() {
374                    return new ImageWrapper(_image.toUnescapedModel());
375            }
376    
377            @Override
378            public java.lang.String toXmlString() {
379                    return _image.toXmlString();
380            }
381    
382            @Override
383            public boolean equals(Object obj) {
384                    if (this == obj) {
385                            return true;
386                    }
387    
388                    if (!(obj instanceof ImageWrapper)) {
389                            return false;
390                    }
391    
392                    ImageWrapper imageWrapper = (ImageWrapper)obj;
393    
394                    if (Validator.equals(_image, imageWrapper._image)) {
395                            return true;
396                    }
397    
398                    return false;
399            }
400    
401            /**
402             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
403             */
404            @Deprecated
405            public Image getWrappedImage() {
406                    return _image;
407            }
408    
409            @Override
410            public Image getWrappedModel() {
411                    return _image;
412            }
413    
414            @Override
415            public boolean isEntityCacheEnabled() {
416                    return _image.isEntityCacheEnabled();
417            }
418    
419            @Override
420            public boolean isFinderCacheEnabled() {
421                    return _image.isFinderCacheEnabled();
422            }
423    
424            @Override
425            public void resetOriginalValues() {
426                    _image.resetOriginalValues();
427            }
428    
429            private final Image _image;
430    }