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.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    }