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