001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.counter.model;
016    
017    import java.io.Serializable;
018    
019    import java.util.ArrayList;
020    import java.util.List;
021    
022    /**
023     * This class is used by SOAP remote services.
024     *
025     * @author    Brian Wing Shun Chan
026     * @generated
027     */
028    public class CounterSoap implements Serializable {
029            public static CounterSoap toSoapModel(Counter model) {
030                    CounterSoap soapModel = new CounterSoap();
031    
032                    soapModel.setName(model.getName());
033                    soapModel.setCurrentId(model.getCurrentId());
034    
035                    return soapModel;
036            }
037    
038            public static CounterSoap[] toSoapModels(Counter[] models) {
039                    CounterSoap[] soapModels = new CounterSoap[models.length];
040    
041                    for (int i = 0; i < models.length; i++) {
042                            soapModels[i] = toSoapModel(models[i]);
043                    }
044    
045                    return soapModels;
046            }
047    
048            public static CounterSoap[][] toSoapModels(Counter[][] models) {
049                    CounterSoap[][] soapModels = null;
050    
051                    if (models.length > 0) {
052                            soapModels = new CounterSoap[models.length][models[0].length];
053                    }
054                    else {
055                            soapModels = new CounterSoap[0][0];
056                    }
057    
058                    for (int i = 0; i < models.length; i++) {
059                            soapModels[i] = toSoapModels(models[i]);
060                    }
061    
062                    return soapModels;
063            }
064    
065            public static CounterSoap[] toSoapModels(List<Counter> models) {
066                    List<CounterSoap> soapModels = new ArrayList<CounterSoap>(models.size());
067    
068                    for (Counter model : models) {
069                            soapModels.add(toSoapModel(model));
070                    }
071    
072                    return soapModels.toArray(new CounterSoap[soapModels.size()]);
073            }
074    
075            public CounterSoap() {
076            }
077    
078            public String getPrimaryKey() {
079                    return _name;
080            }
081    
082            public void setPrimaryKey(String pk) {
083                    setName(pk);
084            }
085    
086            public String getName() {
087                    return _name;
088            }
089    
090            public void setName(String name) {
091                    _name = name;
092            }
093    
094            public long getCurrentId() {
095                    return _currentId;
096            }
097    
098            public void setCurrentId(long currentId) {
099                    _currentId = currentId;
100            }
101    
102            private String _name;
103            private long _currentId;
104    }