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