1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.counter.model;
16  
17  import java.io.Serializable;
18  
19  import java.util.ArrayList;
20  import java.util.List;
21  
22  /**
23   * <a href="CounterSoap.java.html"><b><i>View Source</i></b></a>
24   *
25   * <p>
26   * ServiceBuilder generated this class. Modifications in this class will be
27   * overwritten the next time is generated.
28   * </p>
29   *
30   * <p>
31   * This class is used by
32   * {@link com.liferay.counter.service.http.CounterServiceSoap}.
33   * </p>
34   *
35   * @author    Brian Wing Shun Chan
36   * @see       com.liferay.counter.service.http.CounterServiceSoap
37   * @generated
38   */
39  public class CounterSoap implements Serializable {
40      public static CounterSoap toSoapModel(Counter model) {
41          CounterSoap soapModel = new CounterSoap();
42  
43          soapModel.setName(model.getName());
44          soapModel.setCurrentId(model.getCurrentId());
45  
46          return soapModel;
47      }
48  
49      public static CounterSoap[] toSoapModels(Counter[] models) {
50          CounterSoap[] soapModels = new CounterSoap[models.length];
51  
52          for (int i = 0; i < models.length; i++) {
53              soapModels[i] = toSoapModel(models[i]);
54          }
55  
56          return soapModels;
57      }
58  
59      public static CounterSoap[][] toSoapModels(Counter[][] models) {
60          CounterSoap[][] soapModels = null;
61  
62          if (models.length > 0) {
63              soapModels = new CounterSoap[models.length][models[0].length];
64          }
65          else {
66              soapModels = new CounterSoap[0][0];
67          }
68  
69          for (int i = 0; i < models.length; i++) {
70              soapModels[i] = toSoapModels(models[i]);
71          }
72  
73          return soapModels;
74      }
75  
76      public static CounterSoap[] toSoapModels(List<Counter> models) {
77          List<CounterSoap> soapModels = new ArrayList<CounterSoap>(models.size());
78  
79          for (Counter model : models) {
80              soapModels.add(toSoapModel(model));
81          }
82  
83          return soapModels.toArray(new CounterSoap[soapModels.size()]);
84      }
85  
86      public CounterSoap() {
87      }
88  
89      public String getPrimaryKey() {
90          return _name;
91      }
92  
93      public void setPrimaryKey(String pk) {
94          setName(pk);
95      }
96  
97      public String getName() {
98          return _name;
99      }
100 
101     public void setName(String name) {
102         _name = name;
103     }
104 
105     public long getCurrentId() {
106         return _currentId;
107     }
108 
109     public void setCurrentId(long currentId) {
110         _currentId = currentId;
111     }
112 
113     private String _name;
114     private long _currentId;
115 }