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