001    /**
002     * Copyright (c) 2000-present 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 aQute.bnd.annotation.ProviderType;
018    
019    import java.io.Serializable;
020    
021    import java.util.ArrayList;
022    import java.util.List;
023    
024    /**
025     * This class is used by SOAP remote services.
026     *
027     * @author Brian Wing Shun Chan
028     * @generated
029     */
030    @ProviderType
031    public class CounterSoap implements Serializable {
032            public static CounterSoap toSoapModel(Counter model) {
033                    CounterSoap soapModel = new CounterSoap();
034    
035                    soapModel.setName(model.getName());
036                    soapModel.setCurrentId(model.getCurrentId());
037    
038                    return soapModel;
039            }
040    
041            public static CounterSoap[] toSoapModels(Counter[] models) {
042                    CounterSoap[] soapModels = new CounterSoap[models.length];
043    
044                    for (int i = 0; i < models.length; i++) {
045                            soapModels[i] = toSoapModel(models[i]);
046                    }
047    
048                    return soapModels;
049            }
050    
051            public static CounterSoap[][] toSoapModels(Counter[][] models) {
052                    CounterSoap[][] soapModels = null;
053    
054                    if (models.length > 0) {
055                            soapModels = new CounterSoap[models.length][models[0].length];
056                    }
057                    else {
058                            soapModels = new CounterSoap[0][0];
059                    }
060    
061                    for (int i = 0; i < models.length; i++) {
062                            soapModels[i] = toSoapModels(models[i]);
063                    }
064    
065                    return soapModels;
066            }
067    
068            public static CounterSoap[] toSoapModels(List<Counter> models) {
069                    List<CounterSoap> soapModels = new ArrayList<CounterSoap>(models.size());
070    
071                    for (Counter model : models) {
072                            soapModels.add(toSoapModel(model));
073                    }
074    
075                    return soapModels.toArray(new CounterSoap[soapModels.size()]);
076            }
077    
078            public CounterSoap() {
079            }
080    
081            public String getPrimaryKey() {
082                    return _name;
083            }
084    
085            public void setPrimaryKey(String pk) {
086                    setName(pk);
087            }
088    
089            public String getName() {
090                    return _name;
091            }
092    
093            public void setName(String name) {
094                    _name = name;
095            }
096    
097            public long getCurrentId() {
098                    return _currentId;
099            }
100    
101            public void setCurrentId(long currentId) {
102                    _currentId = currentId;
103            }
104    
105            private String _name;
106            private long _currentId;
107    }