2 * Copyright (c) 2017. Developed by Hedgecode.
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 package org.hedgecode.snooker.json;
19 import java.util.Date;
21 import com.google.gson.annotations.Expose;
22 import com.google.gson.annotations.SerializedName;
24 import org.hedgecode.snooker.api.Event;
25 import org.hedgecode.snooker.api.Season;
28 * Event Entity to JSON deserialize.
30 * @author Dmitry Samoshin aka gotty
32 public class JsonEvent extends JsonIdEntity implements Event {
36 @SerializedName("Name")
38 @SerializedName("StartDate")
39 private Date startDate;
40 @SerializedName("EndDate")
42 @SerializedName("Sponsor")
43 private String sponsor;
44 @SerializedName("Season")
45 private int seasonYear;
47 private Season season;
48 @SerializedName("Type")
50 @SerializedName("Num")
52 @SerializedName("Venue")
54 @SerializedName("City")
56 @SerializedName("Country")
57 private String country;
58 @SerializedName("Discipline")
59 private String discipline;
60 @SerializedName("Main")
61 private int mainEventId;
63 private Event mainEvent;
64 @SerializedName("Sex")
66 @SerializedName("AgeGroup")
67 private String ageGroup;
68 @SerializedName("Url")
70 @SerializedName("Related")
71 private String related;
72 @SerializedName("Stage")
74 @SerializedName("ValueType")
75 private String valueType;
76 @SerializedName("ShortName")
77 private String shortName;
78 @SerializedName("WorldSnookerId")
79 private int worldSnookerId;
80 @SerializedName("RankingType")
81 private String rankingType;
82 @SerializedName("EventPredictionID")
83 private int eventPredictionId;
84 @SerializedName("Team")
86 @SerializedName("Format")
88 @SerializedName("Twitter")
89 private String twitter;
90 @SerializedName("HashTag")
91 private String hashTag;
92 @SerializedName("ConversionRate")
93 private float conversionRate;
94 @SerializedName("AllRoundsAdded")
95 private boolean allRoundsAdded;
96 @SerializedName("PhotoURLs")
97 private String photoUrls;
98 @SerializedName("NumCompetitors")
99 private int numCompetitors;
100 @SerializedName("NumUpcoming")
101 private int numUpcoming;
102 @SerializedName("NumActive")
103 private int numActive;
104 @SerializedName("NumResults")
105 private int numResults;
106 @SerializedName("Note")
108 @SerializedName("CommonNote")
109 private String commonNote;
110 @SerializedName("DefendingChampion")
111 private int defendingChampion;
112 @SerializedName("PreviousEdition")
113 private int previousEdition;
116 public int eventId() {
121 public String name() {
126 public Date startDate() {
131 public Date endDate() {
136 public String sponsor() {
141 public Season season() {
143 season = Season.getSeason(seasonYear);
148 public String type() {
158 public String venue() {
163 public String city() {
168 public String country() {
173 public String discipline() {
178 public int mainEventId() {
183 public Event mainEvent() {
184 if (mainEvent == null && mainEventId == eventId)
189 public void setMainEvent(Event event) {
190 if (event != null && eventId == event.eventId())
195 public String sex() {
200 public String ageGroup() {
205 public String url() {
210 public String related() {
215 public String stage() {
220 public String valueType() {
225 public String shortName() {
230 public int worldSnookerId() {
231 return worldSnookerId;
235 public String rankingType() {
240 public int eventPredictionId() {
241 return eventPredictionId;
245 public boolean team() {
250 public int format() {
255 public String twitter() {
260 public String hashTag() {
265 public float conversionRate() {
266 return conversionRate;
270 public boolean allRoundsAdded() {
271 return allRoundsAdded;
275 public String photoUrls() {
280 public int numCompetitors() {
281 return numCompetitors;
285 public int numUpcoming() {
290 public int numActive() {
295 public int numResults() {
300 public String note() {
305 public String commonNote() {
310 public int defendingChampion() {
311 return defendingChampion;
315 public int previousEdition() {
316 return previousEdition;