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