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            public Class<?> getModelClass() {
038                    return VirtualHost.class;
039            }
040    
041            public String getModelClassName() {
042                    return VirtualHost.class.getName();
043            }
044    
045            public Map<String, Object> getModelAttributes() {
046                    Map<String, Object> attributes = new HashMap<String, Object>();
047    
048                    attributes.put("virtualHostId", getVirtualHostId());
049                    attributes.put("companyId", getCompanyId());
050                    attributes.put("layoutSetId", getLayoutSetId());
051                    attributes.put("hostname", getHostname());
052    
053                    return attributes;
054            }
055    
056            public void setModelAttributes(Map<String, Object> attributes) {
057                    Long virtualHostId = (Long)attributes.get("virtualHostId");
058    
059                    if (virtualHostId != null) {
060                            setVirtualHostId(virtualHostId);
061                    }
062    
063                    Long companyId = (Long)attributes.get("companyId");
064    
065                    if (companyId != null) {
066                            setCompanyId(companyId);
067                    }
068    
069                    Long layoutSetId = (Long)attributes.get("layoutSetId");
070    
071                    if (layoutSetId != null) {
072                            setLayoutSetId(layoutSetId);
073                    }
074    
075                    String hostname = (String)attributes.get("hostname");
076    
077                    if (hostname != null) {
078                            setHostname(hostname);
079                    }
080            }
081    
082            /**
083            * Returns the primary key of this virtual host.
084            *
085            * @return the primary key of this virtual host
086            */
087            public long getPrimaryKey() {
088                    return _virtualHost.getPrimaryKey();
089            }
090    
091            /**
092            * Sets the primary key of this virtual host.
093            *
094            * @param primaryKey the primary key of this virtual host
095            */
096            public void setPrimaryKey(long primaryKey) {
097                    _virtualHost.setPrimaryKey(primaryKey);
098            }
099    
100            /**
101            * Returns the virtual host ID of this virtual host.
102            *
103            * @return the virtual host ID of this virtual host
104            */
105            public long getVirtualHostId() {
106                    return _virtualHost.getVirtualHostId();
107            }
108    
109            /**
110            * Sets the virtual host ID of this virtual host.
111            *
112            * @param virtualHostId the virtual host ID of this virtual host
113            */
114            public void setVirtualHostId(long virtualHostId) {
115                    _virtualHost.setVirtualHostId(virtualHostId);
116            }
117    
118            /**
119            * Returns the company ID of this virtual host.
120            *
121            * @return the company ID of this virtual host
122            */
123            public long getCompanyId() {
124                    return _virtualHost.getCompanyId();
125            }
126    
127            /**
128            * Sets the company ID of this virtual host.
129            *
130            * @param companyId the company ID of this virtual host
131            */
132            public void setCompanyId(long companyId) {
133                    _virtualHost.setCompanyId(companyId);
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            public long getLayoutSetId() {
142                    return _virtualHost.getLayoutSetId();
143            }
144    
145            /**
146            * Sets the layout set ID of this virtual host.
147            *
148            * @param layoutSetId the layout set ID of this virtual host
149            */
150            public void setLayoutSetId(long layoutSetId) {
151                    _virtualHost.setLayoutSetId(layoutSetId);
152            }
153    
154            /**
155            * Returns the hostname of this virtual host.
156            *
157            * @return the hostname of this virtual host
158            */
159            public java.lang.String getHostname() {
160                    return _virtualHost.getHostname();
161            }
162    
163            /**
164            * Sets the hostname of this virtual host.
165            *
166            * @param hostname the hostname of this virtual host
167            */
168            public void setHostname(java.lang.String hostname) {
169                    _virtualHost.setHostname(hostname);
170            }
171    
172            public boolean isNew() {
173                    return _virtualHost.isNew();
174            }
175    
176            public void setNew(boolean n) {
177                    _virtualHost.setNew(n);
178            }
179    
180            public boolean isCachedModel() {
181                    return _virtualHost.isCachedModel();
182            }
183    
184            public void setCachedModel(boolean cachedModel) {
185                    _virtualHost.setCachedModel(cachedModel);
186            }
187    
188            public boolean isEscapedModel() {
189                    return _virtualHost.isEscapedModel();
190            }
191    
192            public java.io.Serializable getPrimaryKeyObj() {
193                    return _virtualHost.getPrimaryKeyObj();
194            }
195    
196            public void setPrimaryKeyObj(java.io.Serializable primaryKeyObj) {
197                    _virtualHost.setPrimaryKeyObj(primaryKeyObj);
198            }
199    
200            public com.liferay.portlet.expando.model.ExpandoBridge getExpandoBridge() {
201                    return _virtualHost.getExpandoBridge();
202            }
203    
204            public void setExpandoBridgeAttributes(
205                    com.liferay.portal.service.ServiceContext serviceContext) {
206                    _virtualHost.setExpandoBridgeAttributes(serviceContext);
207            }
208    
209            @Override
210            public java.lang.Object clone() {
211                    return new VirtualHostWrapper((VirtualHost)_virtualHost.clone());
212            }
213    
214            public int compareTo(com.liferay.portal.model.VirtualHost virtualHost) {
215                    return _virtualHost.compareTo(virtualHost);
216            }
217    
218            @Override
219            public int hashCode() {
220                    return _virtualHost.hashCode();
221            }
222    
223            public com.liferay.portal.model.CacheModel<com.liferay.portal.model.VirtualHost> toCacheModel() {
224                    return _virtualHost.toCacheModel();
225            }
226    
227            public com.liferay.portal.model.VirtualHost toEscapedModel() {
228                    return new VirtualHostWrapper(_virtualHost.toEscapedModel());
229            }
230    
231            public com.liferay.portal.model.VirtualHost toUnescapedModel() {
232                    return new VirtualHostWrapper(_virtualHost.toUnescapedModel());
233            }
234    
235            @Override
236            public java.lang.String toString() {
237                    return _virtualHost.toString();
238            }
239    
240            public java.lang.String toXmlString() {
241                    return _virtualHost.toXmlString();
242            }
243    
244            public void persist()
245                    throws com.liferay.portal.kernel.exception.SystemException {
246                    _virtualHost.persist();
247            }
248    
249            @Override
250            public boolean equals(Object obj) {
251                    if (this == obj) {
252                            return true;
253                    }
254    
255                    if (!(obj instanceof VirtualHostWrapper)) {
256                            return false;
257                    }
258    
259                    VirtualHostWrapper virtualHostWrapper = (VirtualHostWrapper)obj;
260    
261                    if (Validator.equals(_virtualHost, virtualHostWrapper._virtualHost)) {
262                            return true;
263                    }
264    
265                    return false;
266            }
267    
268            /**
269             * @deprecated Renamed to {@link #getWrappedModel}
270             */
271            public VirtualHost getWrappedVirtualHost() {
272                    return _virtualHost;
273            }
274    
275            public VirtualHost getWrappedModel() {
276                    return _virtualHost;
277            }
278    
279            public void resetOriginalValues() {
280                    _virtualHost.resetOriginalValues();
281            }
282    
283            private VirtualHost _virtualHost;
284    }