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.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("imageId", getImageId());
055                    attributes.put("modifiedDate", getModifiedDate());
056                    attributes.put("type", getType());
057                    attributes.put("height", getHeight());
058                    attributes.put("width", getWidth());
059                    attributes.put("size", getSize());
060    
061                    return attributes;
062            }
063    
064            @Override
065            public void setModelAttributes(Map<String, Object> attributes) {
066                    Long imageId = (Long)attributes.get("imageId");
067    
068                    if (imageId != null) {
069                            setImageId(imageId);
070                    }
071    
072                    Date modifiedDate = (Date)attributes.get("modifiedDate");
073    
074                    if (modifiedDate != null) {
075                            setModifiedDate(modifiedDate);
076                    }
077    
078                    String type = (String)attributes.get("type");
079    
080                    if (type != null) {
081                            setType(type);
082                    }
083    
084                    Integer height = (Integer)attributes.get("height");
085    
086                    if (height != null) {
087                            setHeight(height);
088                    }
089    
090                    Integer width = (Integer)attributes.get("width");
091    
092                    if (width != null) {
093                            setWidth(width);
094                    }
095    
096                    Integer size = (Integer)attributes.get("size");
097    
098                    if (size != null) {
099                            setSize(size);
100                    }
101            }
102    
103            /**
104            * Returns the primary key of this image.
105            *
106            * @return the primary key of this image
107            */
108            @Override
109            public long getPrimaryKey() {
110                    return _image.getPrimaryKey();
111            }
112    
113            /**
114            * Sets the primary key of this image.
115            *
116            * @param primaryKey the primary key of this image
117            */
118            @Override
119            public void setPrimaryKey(long primaryKey) {
120                    _image.setPrimaryKey(primaryKey);
121            }
122    
123            /**
124            * Returns the image ID of this image.
125            *
126            * @return the image ID of this image
127            */
128            @Override
129            public long getImageId() {
130                    return _image.getImageId();
131            }
132    
133            /**
134            * Sets the image ID of this image.
135            *
136            * @param imageId the image ID of this image
137            */
138            @Override
139            public void setImageId(long imageId) {
140                    _image.setImageId(imageId);
141            }
142    
143            /**
144            * Returns the modified date of this image.
145            *
146            * @return the modified date of this image
147            */
148            @Override
149            public java.util.Date getModifiedDate() {
150                    return _image.getModifiedDate();
151            }
152    
153            /**
154            * Sets the modified date of this image.
155            *
156            * @param modifiedDate the modified date of this image
157            */
158            @Override
159            public void setModifiedDate(java.util.Date modifiedDate) {
160                    _image.setModifiedDate(modifiedDate);
161            }
162    
163            /**
164            * Returns the type of this image.
165            *
166            * @return the type of this image
167            */
168            @Override
169            public java.lang.String getType() {
170                    return _image.getType();
171            }
172    
173            /**
174            * Sets the type of this image.
175            *
176            * @param type the type of this image
177            */
178            @Override
179            public void setType(java.lang.String type) {
180                    _image.setType(type);
181            }
182    
183            /**
184            * Returns the height of this image.
185            *
186            * @return the height of this image
187            */
188            @Override
189            public int getHeight() {
190                    return _image.getHeight();
191            }
192    
193            /**
194            * Sets the height of this image.
195            *
196            * @param height the height of this image
197            */
198            @Override
199            public void setHeight(int height) {
200                    _image.setHeight(height);
201            }
202    
203            /**
204            * Returns the width of this image.
205            *
206            * @return the width of this image
207            */
208            @Override
209            public int getWidth() {
210                    return _image.getWidth();
211            }
212    
213            /**
214            * Sets the width of this image.
215            *
216            * @param width the width of this image
217            */
218            @Override
219            public void setWidth(int width) {
220                    _image.setWidth(width);
221            }
222    
223            /**
224            * Returns the size of this image.
225            *
226            * @return the size of this image
227            */
228            @Override
229            public int getSize() {
230                    return _image.getSize();
231            }
232    
233            /**
234            * Sets the size of this image.
235            *
236            * @param size the size of this image
237            */
238            @Override
239            public void setSize(int size) {
240                    _image.setSize(size);
241            }
242    
243            @Override
244            public boolean isNew() {
245                    return _image.isNew();
246            }
247    
248            @Override
249            public void setNew(boolean n) {
250                    _image.setNew(n);
251            }
252    
253            @Override
254            public boolean isCachedModel() {
255                    return _image.isCachedModel();
256            }
257    
258            @Override
259            public void setCachedModel(boolean cachedModel) {
260                    _image.setCachedModel(cachedModel);
261            }
262    
263            @Override
264            public boolean isEscapedModel() {
265                    return _image.isEscapedModel();
266            }
267    
268            @Override
269            public java.io.Serializable getPrimaryKeyObj() {
270                    return _image.getPrimaryKeyObj();
271            }
272    
273            @Override
274            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
275                    _image.setPrimaryKeyObj(primaryKeyObj);
276            }
277    
278            @Override
279            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
280                    return _image.getExpandoBridge();
281            }
282    
283            @Override
284            public void setExpandoBridgeAttributes(
285                    com.liferay.portal.model.BaseModel<?> baseModel) {
286                    _image.setExpandoBridgeAttributes(baseModel);
287            }
288    
289            @Override
290            public void setExpandoBridgeAttributes(
291                    com.liferay.portlet.expando.model.ExpandoBridge expandoBridge) {
292                    _image.setExpandoBridgeAttributes(expandoBridge);
293            }
294    
295            @Override
296            public void setExpandoBridgeAttributes(
297                    com.liferay.portal.service.ServiceContext serviceContext) {
298                    _image.setExpandoBridgeAttributes(serviceContext);
299            }
300    
301            @Override
302            public java.lang.Object clone() {
303                    return new ImageWrapper((Image)_image.clone());
304            }
305    
306            @Override
307            public int compareTo(com.liferay.portal.model.Image image) {
308                    return _image.compareTo(image);
309            }
310    
311            @Override
312            public int hashCode() {
313                    return _image.hashCode();
314            }
315    
316            @Override
317            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.Image> toCacheModel() {
318                    return _image.toCacheModel();
319            }
320    
321            @Override
322            public com.liferay.portal.model.Image toEscapedModel() {
323                    return new ImageWrapper(_image.toEscapedModel());
324            }
325    
326            @Override
327            public com.liferay.portal.model.Image toUnescapedModel() {
328                    return new ImageWrapper(_image.toUnescapedModel());
329            }
330    
331            @Override
332            public java.lang.String toString() {
333                    return _image.toString();
334            }
335    
336            @Override
337            public java.lang.String toXmlString() {
338                    return _image.toXmlString();
339            }
340    
341            @Override
342            public void persist()
343                    throws com.liferay.portal.kernel.exception.SystemException {
344                    _image.persist();
345            }
346    
347            @Override
348            public byte[] getTextObj() {
349                    return _image.getTextObj();
350            }
351    
352            @Override
353            public void setTextObj(byte[] textObj) {
354                    _image.setTextObj(textObj);
355            }
356    
357            @Override
358            public boolean equals(Object obj) {
359                    if (this == obj) {
360                            return true;
361                    }
362    
363                    if (!(obj instanceof ImageWrapper)) {
364                            return false;
365                    }
366    
367                    ImageWrapper imageWrapper = (ImageWrapper)obj;
368    
369                    if (Validator.equals(_image, imageWrapper._image)) {
370                            return true;
371                    }
372    
373                    return false;
374            }
375    
376            /**
377             * @deprecated As of 6.1.0, replaced by {@link #getWrappedModel}
378             */
379            public Image getWrappedImage() {
380                    return _image;
381            }
382    
383            @Override
384            public Image getWrappedModel() {
385                    return _image;
386            }
387    
388            @Override
389            public void resetOriginalValues() {
390                    _image.resetOriginalValues();
391            }
392    
393            private Image _image;
394    }