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.model;
016    
017    import aQute.bnd.annotation.ProviderType;
018    
019    import com.liferay.portal.kernel.util.Validator;
020    import com.liferay.portal.service.ServiceContext;
021    
022    import com.liferay.portlet.expando.model.ExpandoBridge;
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(com.liferay.portal.model.VirtualHost virtualHost) {
108                    return _virtualHost.compareTo(virtualHost);
109            }
110    
111            /**
112            * Returns the company ID of this virtual host.
113            *
114            * @return the company ID of this virtual host
115            */
116            @Override
117            public long getCompanyId() {
118                    return _virtualHost.getCompanyId();
119            }
120    
121            @Override
122            public ExpandoBridge getExpandoBridge() {
123                    return _virtualHost.getExpandoBridge();
124            }
125    
126            /**
127            * Returns the hostname of this virtual host.
128            *
129            * @return the hostname of this virtual host
130            */
131            @Override
132            public java.lang.String getHostname() {
133                    return _virtualHost.getHostname();
134            }
135    
136            /**
137            * Returns the layout set ID of this virtual host.
138            *
139            * @return the layout set ID of this virtual host
140            */
141            @Override
142            public long getLayoutSetId() {
143                    return _virtualHost.getLayoutSetId();
144            }
145    
146            /**
147            * Returns the mvcc version of this virtual host.
148            *
149            * @return the mvcc version of this virtual host
150            */
151            @Override
152            public long getMvccVersion() {
153                    return _virtualHost.getMvccVersion();
154            }
155    
156            /**
157            * Returns the primary key of this virtual host.
158            *
159            * @return the primary key of this virtual host
160            */
161            @Override
162            public long getPrimaryKey() {
163                    return _virtualHost.getPrimaryKey();
164            }
165    
166            @Override
167            public Serializable getPrimaryKeyObj() {
168                    return _virtualHost.getPrimaryKeyObj();
169            }
170    
171            /**
172            * Returns the virtual host ID of this virtual host.
173            *
174            * @return the virtual host ID of this virtual host
175            */
176            @Override
177            public long getVirtualHostId() {
178                    return _virtualHost.getVirtualHostId();
179            }
180    
181            @Override
182            public int hashCode() {
183                    return _virtualHost.hashCode();
184            }
185    
186            @Override
187            public boolean isCachedModel() {
188                    return _virtualHost.isCachedModel();
189            }
190    
191            @Override
192            public boolean isEscapedModel() {
193                    return _virtualHost.isEscapedModel();
194            }
195    
196            @Override
197            public boolean isNew() {
198                    return _virtualHost.isNew();
199            }
200    
201            @Override
202            public void persist() {
203                    _virtualHost.persist();
204            }
205    
206            @Override
207            public void setCachedModel(boolean cachedModel) {
208                    _virtualHost.setCachedModel(cachedModel);
209            }
210    
211            /**
212            * Sets the company ID of this virtual host.
213            *
214            * @param companyId the company ID of this virtual host
215            */
216            @Override
217            public void setCompanyId(long companyId) {
218                    _virtualHost.setCompanyId(companyId);
219            }
220    
221            @Override
222            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
223                    _virtualHost.setExpandoBridgeAttributes(baseModel);
224            }
225    
226            @Override
227            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
228                    _virtualHost.setExpandoBridgeAttributes(expandoBridge);
229            }
230    
231            @Override
232            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
233                    _virtualHost.setExpandoBridgeAttributes(serviceContext);
234            }
235    
236            /**
237            * Sets the hostname of this virtual host.
238            *
239            * @param hostname the hostname of this virtual host
240            */
241            @Override
242            public void setHostname(java.lang.String hostname) {
243                    _virtualHost.setHostname(hostname);
244            }
245    
246            /**
247            * Sets the layout set ID of this virtual host.
248            *
249            * @param layoutSetId the layout set ID of this virtual host
250            */
251            @Override
252            public void setLayoutSetId(long layoutSetId) {
253                    _virtualHost.setLayoutSetId(layoutSetId);
254            }
255    
256            /**
257            * Sets the mvcc version of this virtual host.
258            *
259            * @param mvccVersion the mvcc version of this virtual host
260            */
261            @Override
262            public void setMvccVersion(long mvccVersion) {
263                    _virtualHost.setMvccVersion(mvccVersion);
264            }
265    
266            @Override
267            public void setNew(boolean n) {
268                    _virtualHost.setNew(n);
269            }
270    
271            /**
272            * Sets the primary key of this virtual host.
273            *
274            * @param primaryKey the primary key of this virtual host
275            */
276            @Override
277            public void setPrimaryKey(long primaryKey) {
278                    _virtualHost.setPrimaryKey(primaryKey);
279            }
280    
281            @Override
282            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
283                    _virtualHost.setPrimaryKeyObj(primaryKeyObj);
284            }
285    
286            /**
287            * Sets the virtual host ID of this virtual host.
288            *
289            * @param virtualHostId the virtual host ID of this virtual host
290            */
291            @Override
292            public void setVirtualHostId(long virtualHostId) {
293                    _virtualHost.setVirtualHostId(virtualHostId);
294            }
295    
296            @Override
297            public CacheModel<com.liferay.portal.model.VirtualHost> toCacheModel() {
298                    return _virtualHost.toCacheModel();
299            }
300    
301            @Override
302            public com.liferay.portal.model.VirtualHost toEscapedModel() {
303                    return new VirtualHostWrapper(_virtualHost.toEscapedModel());
304            }
305    
306            @Override
307            public java.lang.String toString() {
308                    return _virtualHost.toString();
309            }
310    
311            @Override
312            public com.liferay.portal.model.VirtualHost toUnescapedModel() {
313                    return new VirtualHostWrapper(_virtualHost.toUnescapedModel());
314            }
315    
316            @Override
317            public java.lang.String toXmlString() {
318                    return _virtualHost.toXmlString();
319            }
320    
321            @Override
322            public boolean equals(Object obj) {
323                    if (this == obj) {
324                            return true;
325                    }
326    
327                    if (!(obj instanceof VirtualHostWrapper)) {
328                            return false;
329                    }
330    
331                    VirtualHostWrapper virtualHostWrapper = (VirtualHostWrapper)obj;
332    
333                    if (Validator.equals(_virtualHost, virtualHostWrapper._virtualHost)) {
334                            return true;
335                    }
336    
337                    return false;
338            }
339    
340            @Override
341            public VirtualHost getWrappedModel() {
342                    return _virtualHost;
343            }
344    
345            @Override
346            public boolean isEntityCacheEnabled() {
347                    return _virtualHost.isEntityCacheEnabled();
348            }
349    
350            @Override
351            public boolean isFinderCacheEnabled() {
352                    return _virtualHost.isFinderCacheEnabled();
353            }
354    
355            @Override
356            public void resetOriginalValues() {
357                    _virtualHost.resetOriginalValues();
358            }
359    
360            private final VirtualHost _virtualHost;
361    }