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            public Class<?> getModelClass() {
038                    return Image.class;
039            }
040    
041            public String getModelClassName() {
042                    return Image.class.getName();
043            }
044    
045            public Map<String, Object> getModelAttributes() {
046                    Map<String, Object> attributes = new HashMap<String, Object>();
047    
048                    attributes.put("imageId", getImageId());
049                    attributes.put("modifiedDate", getModifiedDate());
050                    attributes.put("text", getText());
051                    attributes.put("type", getType());
052                    attributes.put("height", getHeight());
053                    attributes.put("width", getWidth());
054                    attributes.put("size", getSize());
055    
056                    return attributes;
057            }
058    
059            public void setModelAttributes(Map<String, Object> attributes) {
060                    Long imageId = (Long)attributes.get("imageId");
061    
062                    if (imageId != null) {
063                            setImageId(imageId);
064                    }
065    
066                    Date modifiedDate = (Date)attributes.get("modifiedDate");
067    
068                    if (modifiedDate != null) {
069                            setModifiedDate(modifiedDate);
070                    }
071    
072                    String text = (String)attributes.get("text");
073    
074                    if (text != null) {
075                            setText(text);
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            public long getPrimaryKey() {
109                    return _image.getPrimaryKey();
110            }
111    
112            /**
113            * Sets the primary key of this image.
114            *
115            * @param primaryKey the primary key of this image
116            */
117            public void setPrimaryKey(long primaryKey) {
118                    _image.setPrimaryKey(primaryKey);
119            }
120    
121            /**
122            * Returns the image ID of this image.
123            *
124            * @return the image ID of this image
125            */
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            public void setImageId(long imageId) {
136                    _image.setImageId(imageId);
137            }
138    
139            /**
140            * Returns the modified date of this image.
141            *
142            * @return the modified date of this image
143            */
144            public java.util.Date getModifiedDate() {
145                    return _image.getModifiedDate();
146            }
147    
148            /**
149            * Sets the modified date of this image.
150            *
151            * @param modifiedDate the modified date of this image
152            */
153            public void setModifiedDate(java.util.Date modifiedDate) {
154                    _image.setModifiedDate(modifiedDate);
155            }
156    
157            /**
158            * Returns the text of this image.
159            *
160            * @return the text of this image
161            */
162            public java.lang.String getText() {
163                    return _image.getText();
164            }
165    
166            /**
167            * Sets the text of this image.
168            *
169            * @param text the text of this image
170            */
171            public void setText(java.lang.String text) {
172                    _image.setText(text);
173            }
174    
175            /**
176            * Returns the type of this image.
177            *
178            * @return the type of this image
179            */
180            public java.lang.String getType() {
181                    return _image.getType();
182            }
183    
184            /**
185            * Sets the type of this image.
186            *
187            * @param type the type of this image
188            */
189            public void setType(java.lang.String type) {
190                    _image.setType(type);
191            }
192    
193            /**
194            * Returns the height of this image.
195            *
196            * @return the height of this image
197            */
198            public int getHeight() {
199                    return _image.getHeight();
200            }
201    
202            /**
203            * Sets the height of this image.
204            *
205            * @param height the height of this image
206            */
207            public void setHeight(int height) {
208                    _image.setHeight(height);
209            }
210    
211            /**
212            * Returns the width of this image.
213            *
214            * @return the width of this image
215            */
216            public int getWidth() {
217                    return _image.getWidth();
218            }
219    
220            /**
221            * Sets the width of this image.
222            *
223            * @param width the width of this image
224            */
225            public void setWidth(int width) {
226                    _image.setWidth(width);
227            }
228    
229            /**
230            * Returns the size of this image.
231            *
232            * @return the size of this image
233            */
234            public int getSize() {
235                    return _image.getSize();
236            }
237    
238            /**
239            * Sets the size of this image.
240            *
241            * @param size the size of this image
242            */
243            public void setSize(int size) {
244                    _image.setSize(size);
245            }
246    
247            public boolean isNew() {
248                    return _image.isNew();
249            }
250    
251            public void setNew(boolean n) {
252                    _image.setNew(n);
253            }
254    
255            public boolean isCachedModel() {
256                    return _image.isCachedModel();
257            }
258    
259            public void setCachedModel(boolean cachedModel) {
260                    _image.setCachedModel(cachedModel);
261            }
262    
263            public boolean isEscapedModel() {
264                    return _image.isEscapedModel();
265            }
266    
267            public java.io.Serializable getPrimaryKeyObj() {
268                    return _image.getPrimaryKeyObj();
269            }
270    
271            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
272                    _image.setPrimaryKeyObj(primaryKeyObj);
273            }
274    
275            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
276                    return _image.getExpandoBridge();
277            }
278    
279            public void setExpandoBridgeAttributes(
280                    com.liferay.portal.service.ServiceContext serviceContext) {
281                    _image.setExpandoBridgeAttributes(serviceContext);
282            }
283    
284            @Override
285            public java.lang.Object clone() {
286                    return new ImageWrapper((Image)_image.clone());
287            }
288    
289            public int compareTo(com.liferay.portal.model.Image image) {
290                    return _image.compareTo(image);
291            }
292    
293            @Override
294            public int hashCode() {
295                    return _image.hashCode();
296            }
297    
298            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.Image> toCacheModel() {
299                    return _image.toCacheModel();
300            }
301    
302            public com.liferay.portal.model.Image toEscapedModel() {
303                    return new ImageWrapper(_image.toEscapedModel());
304            }
305    
306            public com.liferay.portal.model.Image toUnescapedModel() {
307                    return new ImageWrapper(_image.toUnescapedModel());
308            }
309    
310            @Override
311            public java.lang.String toString() {
312                    return _image.toString();
313            }
314    
315            public java.lang.String toXmlString() {
316                    return _image.toXmlString();
317            }
318    
319            public void persist()
320                    throws com.liferay.portal.kernel.exception.SystemException {
321                    _image.persist();
322            }
323    
324            public byte[] getTextObj() {
325                    return _image.getTextObj();
326            }
327    
328            public void setTextObj(byte[] textObj) {
329                    _image.setTextObj(textObj);
330            }
331    
332            @Override
333            public boolean equals(Object obj) {
334                    if (this == obj) {
335                            return true;
336                    }
337    
338                    if (!(obj instanceof ImageWrapper)) {
339                            return false;
340                    }
341    
342                    ImageWrapper imageWrapper = (ImageWrapper)obj;
343    
344                    if (Validator.equals(_image, imageWrapper._image)) {
345                            return true;
346                    }
347    
348                    return false;
349            }
350    
351            /**
352             * @deprecated Renamed to {@link #getWrappedModel}
353             */
354            public Image getWrappedImage() {
355                    return _image;
356            }
357    
358            public Image getWrappedModel() {
359                    return _image;
360            }
361    
362            public void resetOriginalValues() {
363                    _image.resetOriginalValues();
364            }
365    
366            private Image _image;
367    }