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