1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portlet.ratings.model;
21  
22  import java.io.Serializable;
23  
24  import java.util.ArrayList;
25  import java.util.List;
26  
27  /**
28   * <a href="RatingsStatsSoap.java.html"><b><i>View Source</i></b></a>
29   *
30   * <p>
31   * ServiceBuilder generated this class. Modifications in this class will be
32   * overwritten the next time is generated.
33   * </p>
34   *
35   * <p>
36   * This class is used by
37   * <code>com.liferay.portlet.ratings.service.http.RatingsStatsServiceSoap</code>.
38   * </p>
39   *
40   * @author Brian Wing Shun Chan
41   *
42   * @see com.liferay.portlet.ratings.service.http.RatingsStatsServiceSoap
43   *
44   */
45  public class RatingsStatsSoap implements Serializable {
46      public static RatingsStatsSoap toSoapModel(RatingsStats model) {
47          RatingsStatsSoap soapModel = new RatingsStatsSoap();
48  
49          soapModel.setStatsId(model.getStatsId());
50          soapModel.setClassNameId(model.getClassNameId());
51          soapModel.setClassPK(model.getClassPK());
52          soapModel.setTotalEntries(model.getTotalEntries());
53          soapModel.setTotalScore(model.getTotalScore());
54          soapModel.setAverageScore(model.getAverageScore());
55  
56          return soapModel;
57      }
58  
59      public static RatingsStatsSoap[] toSoapModels(RatingsStats[] models) {
60          RatingsStatsSoap[] soapModels = new RatingsStatsSoap[models.length];
61  
62          for (int i = 0; i < models.length; i++) {
63              soapModels[i] = toSoapModel(models[i]);
64          }
65  
66          return soapModels;
67      }
68  
69      public static RatingsStatsSoap[][] toSoapModels(RatingsStats[][] models) {
70          RatingsStatsSoap[][] soapModels = null;
71  
72          if (models.length > 0) {
73              soapModels = new RatingsStatsSoap[models.length][models[0].length];
74          }
75          else {
76              soapModels = new RatingsStatsSoap[0][0];
77          }
78  
79          for (int i = 0; i < models.length; i++) {
80              soapModels[i] = toSoapModels(models[i]);
81          }
82  
83          return soapModels;
84      }
85  
86      public static RatingsStatsSoap[] toSoapModels(List<RatingsStats> models) {
87          List<RatingsStatsSoap> soapModels = new ArrayList<RatingsStatsSoap>(models.size());
88  
89          for (RatingsStats model : models) {
90              soapModels.add(toSoapModel(model));
91          }
92  
93          return soapModels.toArray(new RatingsStatsSoap[soapModels.size()]);
94      }
95  
96      public RatingsStatsSoap() {
97      }
98  
99      public long getPrimaryKey() {
100         return _statsId;
101     }
102 
103     public void setPrimaryKey(long pk) {
104         setStatsId(pk);
105     }
106 
107     public long getStatsId() {
108         return _statsId;
109     }
110 
111     public void setStatsId(long statsId) {
112         _statsId = statsId;
113     }
114 
115     public long getClassNameId() {
116         return _classNameId;
117     }
118 
119     public void setClassNameId(long classNameId) {
120         _classNameId = classNameId;
121     }
122 
123     public long getClassPK() {
124         return _classPK;
125     }
126 
127     public void setClassPK(long classPK) {
128         _classPK = classPK;
129     }
130 
131     public int getTotalEntries() {
132         return _totalEntries;
133     }
134 
135     public void setTotalEntries(int totalEntries) {
136         _totalEntries = totalEntries;
137     }
138 
139     public double getTotalScore() {
140         return _totalScore;
141     }
142 
143     public void setTotalScore(double totalScore) {
144         _totalScore = totalScore;
145     }
146 
147     public double getAverageScore() {
148         return _averageScore;
149     }
150 
151     public void setAverageScore(double averageScore) {
152         _averageScore = averageScore;
153     }
154 
155     private long _statsId;
156     private long _classNameId;
157     private long _classPK;
158     private int _totalEntries;
159     private double _totalScore;
160     private double _averageScore;
161 }