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.portlet.ratings.model;
16  
17  import java.io.Serializable;
18  
19  import java.util.ArrayList;
20  import java.util.List;
21  
22  /**
23   * <a href="RatingsStatsSoap.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.portlet.ratings.service.http.RatingsStatsServiceSoap}.
33   * </p>
34   *
35   * @author    Brian Wing Shun Chan
36   * @see       com.liferay.portlet.ratings.service.http.RatingsStatsServiceSoap
37   * @generated
38   */
39  public class RatingsStatsSoap implements Serializable {
40      public static RatingsStatsSoap toSoapModel(RatingsStats model) {
41          RatingsStatsSoap soapModel = new RatingsStatsSoap();
42  
43          soapModel.setStatsId(model.getStatsId());
44          soapModel.setClassNameId(model.getClassNameId());
45          soapModel.setClassPK(model.getClassPK());
46          soapModel.setTotalEntries(model.getTotalEntries());
47          soapModel.setTotalScore(model.getTotalScore());
48          soapModel.setAverageScore(model.getAverageScore());
49  
50          return soapModel;
51      }
52  
53      public static RatingsStatsSoap[] toSoapModels(RatingsStats[] models) {
54          RatingsStatsSoap[] soapModels = new RatingsStatsSoap[models.length];
55  
56          for (int i = 0; i < models.length; i++) {
57              soapModels[i] = toSoapModel(models[i]);
58          }
59  
60          return soapModels;
61      }
62  
63      public static RatingsStatsSoap[][] toSoapModels(RatingsStats[][] models) {
64          RatingsStatsSoap[][] soapModels = null;
65  
66          if (models.length > 0) {
67              soapModels = new RatingsStatsSoap[models.length][models[0].length];
68          }
69          else {
70              soapModels = new RatingsStatsSoap[0][0];
71          }
72  
73          for (int i = 0; i < models.length; i++) {
74              soapModels[i] = toSoapModels(models[i]);
75          }
76  
77          return soapModels;
78      }
79  
80      public static RatingsStatsSoap[] toSoapModels(List<RatingsStats> models) {
81          List<RatingsStatsSoap> soapModels = new ArrayList<RatingsStatsSoap>(models.size());
82  
83          for (RatingsStats model : models) {
84              soapModels.add(toSoapModel(model));
85          }
86  
87          return soapModels.toArray(new RatingsStatsSoap[soapModels.size()]);
88      }
89  
90      public RatingsStatsSoap() {
91      }
92  
93      public long getPrimaryKey() {
94          return _statsId;
95      }
96  
97      public void setPrimaryKey(long pk) {
98          setStatsId(pk);
99      }
100 
101     public long getStatsId() {
102         return _statsId;
103     }
104 
105     public void setStatsId(long statsId) {
106         _statsId = statsId;
107     }
108 
109     public long getClassNameId() {
110         return _classNameId;
111     }
112 
113     public void setClassNameId(long classNameId) {
114         _classNameId = classNameId;
115     }
116 
117     public long getClassPK() {
118         return _classPK;
119     }
120 
121     public void setClassPK(long classPK) {
122         _classPK = classPK;
123     }
124 
125     public int getTotalEntries() {
126         return _totalEntries;
127     }
128 
129     public void setTotalEntries(int totalEntries) {
130         _totalEntries = totalEntries;
131     }
132 
133     public double getTotalScore() {
134         return _totalScore;
135     }
136 
137     public void setTotalScore(double totalScore) {
138         _totalScore = totalScore;
139     }
140 
141     public double getAverageScore() {
142         return _averageScore;
143     }
144 
145     public void setAverageScore(double averageScore) {
146         _averageScore = averageScore;
147     }
148 
149     private long _statsId;
150     private long _classNameId;
151     private long _classPK;
152     private int _totalEntries;
153     private double _totalScore;
154     private double _averageScore;
155 }