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 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 CacheModel<VirtualHost> toCacheModel() {
103                    return _virtualHost.toCacheModel();
104            }
105    
106            @Override
107            public VirtualHost toEscapedModel() {
108                    return new VirtualHostWrapper(_virtualHost.toEscapedModel());
109            }
110    
111            @Override
112            public VirtualHost toUnescapedModel() {
113                    return new VirtualHostWrapper(_virtualHost.toUnescapedModel());
114            }
115    
116            @Override
117            public boolean isCachedModel() {
118                    return _virtualHost.isCachedModel();
119            }
120    
121            @Override
122            public boolean isEscapedModel() {
123                    return _virtualHost.isEscapedModel();
124            }
125    
126            @Override
127            public boolean isNew() {
128                    return _virtualHost.isNew();
129            }
130    
131            @Override
132            public ExpandoBridge getExpandoBridge() {
133                    return _virtualHost.getExpandoBridge();
134            }
135    
136            @Override
137            public int compareTo(VirtualHost virtualHost) {
138                    return _virtualHost.compareTo(virtualHost);
139            }
140    
141            @Override
142            public int hashCode() {
143                    return _virtualHost.hashCode();
144            }
145    
146            @Override
147            public Serializable getPrimaryKeyObj() {
148                    return _virtualHost.getPrimaryKeyObj();
149            }
150    
151            @Override
152            public java.lang.Object clone() {
153                    return new VirtualHostWrapper((VirtualHost)_virtualHost.clone());
154            }
155    
156            /**
157            * Returns the hostname of this virtual host.
158            *
159            * @return the hostname of this virtual host
160            */
161            @Override
162            public java.lang.String getHostname() {
163                    return _virtualHost.getHostname();
164            }
165    
166            @Override
167            public java.lang.String toString() {
168                    return _virtualHost.toString();
169            }
170    
171            @Override
172            public java.lang.String toXmlString() {
173                    return _virtualHost.toXmlString();
174            }
175    
176            /**
177            * Returns the company ID of this virtual host.
178            *
179            * @return the company ID of this virtual host
180            */
181            @Override
182            public long getCompanyId() {
183                    return _virtualHost.getCompanyId();
184            }
185    
186            /**
187            * Returns the layout set ID of this virtual host.
188            *
189            * @return the layout set ID of this virtual host
190            */
191            @Override
192            public long getLayoutSetId() {
193                    return _virtualHost.getLayoutSetId();
194            }
195    
196            /**
197            * Returns the mvcc version of this virtual host.
198            *
199            * @return the mvcc version of this virtual host
200            */
201            @Override
202            public long getMvccVersion() {
203                    return _virtualHost.getMvccVersion();
204            }
205    
206            /**
207            * Returns the primary key of this virtual host.
208            *
209            * @return the primary key of this virtual host
210            */
211            @Override
212            public long getPrimaryKey() {
213                    return _virtualHost.getPrimaryKey();
214            }
215    
216            /**
217            * Returns the virtual host ID of this virtual host.
218            *
219            * @return the virtual host ID of this virtual host
220            */
221            @Override
222            public long getVirtualHostId() {
223                    return _virtualHost.getVirtualHostId();
224            }
225    
226            @Override
227            public void persist() {
228                    _virtualHost.persist();
229            }
230    
231            @Override
232            public void setCachedModel(boolean cachedModel) {
233                    _virtualHost.setCachedModel(cachedModel);
234            }
235    
236            /**
237            * Sets the company ID of this virtual host.
238            *
239            * @param companyId the company ID of this virtual host
240            */
241            @Override
242            public void setCompanyId(long companyId) {
243                    _virtualHost.setCompanyId(companyId);
244            }
245    
246            @Override
247            public void setExpandoBridgeAttributes(BaseModel<?> baseModel) {
248                    _virtualHost.setExpandoBridgeAttributes(baseModel);
249            }
250    
251            @Override
252            public void setExpandoBridgeAttributes(ExpandoBridge expandoBridge) {
253                    _virtualHost.setExpandoBridgeAttributes(expandoBridge);
254            }
255    
256            @Override
257            public void setExpandoBridgeAttributes(ServiceContext serviceContext) {
258                    _virtualHost.setExpandoBridgeAttributes(serviceContext);
259            }
260    
261            /**
262            * Sets the hostname of this virtual host.
263            *
264            * @param hostname the hostname of this virtual host
265            */
266            @Override
267            public void setHostname(java.lang.String hostname) {
268                    _virtualHost.setHostname(hostname);
269            }
270    
271            /**
272            * Sets the layout set ID of this virtual host.
273            *
274            * @param layoutSetId the layout set ID of this virtual host
275            */
276            @Override
277            public void setLayoutSetId(long layoutSetId) {
278                    _virtualHost.setLayoutSetId(layoutSetId);
279            }
280    
281            /**
282            * Sets the mvcc version of this virtual host.
283            *
284            * @param mvccVersion the mvcc version of this virtual host
285            */
286            @Override
287            public void setMvccVersion(long mvccVersion) {
288                    _virtualHost.setMvccVersion(mvccVersion);
289            }
290    
291            @Override
292            public void setNew(boolean n) {
293                    _virtualHost.setNew(n);
294            }
295    
296            /**
297            * Sets the primary key of this virtual host.
298            *
299            * @param primaryKey the primary key of this virtual host
300            */
301            @Override
302            public void setPrimaryKey(long primaryKey) {
303                    _virtualHost.setPrimaryKey(primaryKey);
304            }
305    
306            @Override
307            public void setPrimaryKeyObj(Serializable primaryKeyObj) {
308                    _virtualHost.setPrimaryKeyObj(primaryKeyObj);
309            }
310    
311            /**
312            * Sets the virtual host ID of this virtual host.
313            *
314            * @param virtualHostId the virtual host ID of this virtual host
315            */
316            @Override
317            public void setVirtualHostId(long virtualHostId) {
318                    _virtualHost.setVirtualHostId(virtualHostId);
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 (Objects.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    }