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 java.util.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(
247                    com.liferay.portal.model.BaseModel<?> baseModel) {
248                    _image.setExpandoBridgeAttributes(baseModel);
249            }
250    
251            @Override
252            public void setExpandoBridgeAttributes(
253                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
254                    _image.setExpandoBridgeAttributes(expandoBridge);
255            }
256    
257            @Override
258            public void setExpandoBridgeAttributes(
259                    com.liferay.portal.service.ServiceContext serviceContext) {
260                    _image.setExpandoBridgeAttributes(serviceContext);
261            }
262    
263            /**
264            * Sets the height of this image.
265            *
266            * @param height the height of this image
267            */
268            @Override
269            public void setHeight(int height) {
270                    _image.setHeight(height);
271            }
272    
273            /**
274            * Sets the image ID of this image.
275            *
276            * @param imageId the image ID of this image
277            */
278            @Override
279            public void setImageId(long imageId) {
280                    _image.setImageId(imageId);
281            }
282    
283            /**
284            * Sets the modified date of this image.
285            *
286            * @param modifiedDate the modified date of this image
287            */
288            @Override
289            public void setModifiedDate(java.util.Date modifiedDate) {
290                    _image.setModifiedDate(modifiedDate);
291            }
292    
293            /**
294            * Sets the mvcc version of this image.
295            *
296            * @param mvccVersion the mvcc version of this image
297            */
298            @Override
299            public void setMvccVersion(long mvccVersion) {
300                    _image.setMvccVersion(mvccVersion);
301            }
302    
303            @Override
304            public void setNew(boolean n) {
305                    _image.setNew(n);
306            }
307    
308            /**
309            * Sets the primary key of this image.
310            *
311            * @param primaryKey the primary key of this image
312            */
313            @Override
314            public void setPrimaryKey(long primaryKey) {
315                    _image.setPrimaryKey(primaryKey);
316            }
317    
318            @Override
319            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
320                    _image.setPrimaryKeyObj(primaryKeyObj);
321            }
322    
323            /**
324            * Sets the size of this image.
325            *
326            * @param size the size of this image
327            */
328            @Override
329            public void setSize(int size) {
330                    _image.setSize(size);
331            }
332    
333            @Override
334            public void setTextObj(byte[] textObj) {
335                    _image.setTextObj(textObj);
336            }
337    
338            /**
339            * Sets the type of this image.
340            *
341            * @param type the type of this image
342            */
343            @Override
344            public void setType(java.lang.String type) {
345                    _image.setType(type);
346            }
347    
348            /**
349            * Sets the width of this image.
350            *
351            * @param width the width of this image
352            */
353            @Override
354            public void setWidth(int width) {
355                    _image.setWidth(width);
356            }
357    
358            @Override
359            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.Image> toCacheModel() {
360                    return _image.toCacheModel();
361            }
362    
363            @Override
364            public com.liferay.portal.model.Image toEscapedModel() {
365                    return new ImageWrapper(_image.toEscapedModel());
366            }
367    
368            @Override
369            public java.lang.String toString() {
370                    return _image.toString();
371            }
372    
373            @Override
374            public com.liferay.portal.model.Image toUnescapedModel() {
375                    return new ImageWrapper(_image.toUnescapedModel());
376            }
377    
378            @Override
379            public java.lang.String toXmlString() {
380                    return _image.toXmlString();
381            }
382    
383            @Override
384            public boolean equals(Object obj) {
385                    if (this == obj) {
386                            return true;
387                    }
388    
389                    if (!(obj instanceof ImageWrapper)) {
390                            return false;
391                    }
392    
393                    ImageWrapper imageWrapper = (ImageWrapper)obj;
394    
395                    if (Validator.equals(_image, imageWrapper._image)) {
396                            return true;
397                    }
398    
399                    return false;
400            }
401    
402            /**
403             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
404             */
405            @Deprecated
406            public Image getWrappedImage() {
407                    return _image;
408            }
409    
410            @Override
411            public Image getWrappedModel() {
412                    return _image;
413            }
414    
415            @Override
416            public boolean isEntityCacheEnabled() {
417                    return _image.isEntityCacheEnabled();
418            }
419    
420            @Override
421            public boolean isFinderCacheEnabled() {
422                    return _image.isFinderCacheEnabled();
423            }
424    
425            @Override
426            public void resetOriginalValues() {
427                    _image.resetOriginalValues();
428            }
429    
430            private final Image _image;
431    }