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