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