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