[LIB-10] SerialVersionUID for Serializable classes
[snooker-score-api.git] / src / main / java / org / hedgecode / snooker / json / JsonRound.java
1 /*
2  * Copyright (c) 2017-2020. Developed by Hedgecode.
3  *
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
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
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.
15  */
16
17 package org.hedgecode.snooker.json;
18
19 import java.io.Serializable;
20
21 import com.google.gson.annotations.Expose;
22 import com.google.gson.annotations.SerializedName;
23
24 import org.hedgecode.snooker.annotation.WithHTMLTags;
25 import org.hedgecode.snooker.api.Event;
26 import org.hedgecode.snooker.api.Round;
27
28 /**
29  * Round Entity to JSON deserialize.
30  *
31  * @author Dmitry Samoshin aka gotty
32  */
33 public class JsonRound extends JsonIdEntity implements Round, Serializable {
34
35     private static final long serialVersionUID = -2010008975829800984L;
36
37     @SerializedName("Round")
38     private int round;
39     @SerializedName("RoundName")
40     private String roundName;
41     @SerializedName("EventID")
42     private int eventId;
43     @Expose
44     private Event event;
45     @SerializedName("MainEvent")
46     private int mainEventId;
47     @Expose
48     private Event mainEvent;
49     @SerializedName("Distance")
50     private int distance;
51     @SerializedName("NumLeft")
52     private int numLeft;
53     @SerializedName("NumMatches")
54     private int numMatches;
55     @WithHTMLTags
56     @SerializedName("Note")
57     private String note;
58     @SerializedName("ValueType")
59     private String valueType;
60     @SerializedName("Rank")
61     private int rank;
62     @SerializedName("Money")
63     private long money;
64     @SerializedName("SeedGetsHalf")
65     private int seedGetsHalf;
66     @SerializedName("ActualMoney")
67     private long actualMoney;
68     @SerializedName("Currency")
69     private String currency;
70     @SerializedName("ConversionRate")
71     private int conversionRate;
72     @SerializedName("Points")
73     private int points;
74     @SerializedName("SeedPoints")
75     private int seedPoints;
76
77     JsonRound() {
78     }
79
80     @Override
81     public int round() {
82         return round;
83     }
84
85     @Override
86     public String roundName() {
87         return roundName;
88     }
89
90     @Override
91     public int eventId() {
92         return eventId;
93     }
94
95     @Override
96     public Event event() {
97         return event;
98     }
99
100     public void setEvent(Event event) {
101         if (event != null && eventId == event.eventId())
102             this.event = event;
103     }
104
105     @Override
106     public int mainEventId() {
107         return mainEventId;
108     }
109
110     @Override
111     public Event mainEvent() {
112         return mainEvent;
113     }
114
115     public void setMainEvent(Event mainEvent) {
116         if (mainEvent != null && mainEventId == mainEvent.eventId())
117             this.mainEvent = mainEvent;
118     }
119
120     @Override
121     public int distance() {
122         return distance;
123     }
124
125     @Override
126     public int numLeft() {
127         return numLeft;
128     }
129
130     @Override
131     public int numMatches() {
132         return numMatches;
133     }
134
135     @Override
136     public String note() {
137         return note;
138     }
139
140     @Override
141     public String valueType() {
142         return valueType;
143     }
144
145     @Override
146     public int rank() {
147         return rank;
148     }
149
150     @Override
151     public long money() {
152         return money;
153     }
154
155     @Override
156     public int seedGetsHalf() {
157         return seedGetsHalf;
158     }
159
160     @Override
161     public long actualMoney() {
162         return actualMoney;
163     }
164
165     @Override
166     public String currency() {
167         return currency;
168     }
169
170     @Override
171     public int conversionRate() {
172         return conversionRate;
173     }
174
175     @Override
176     public int points() {
177         return points;
178     }
179
180     @Override
181     public int seedPoints() {
182         return seedPoints;
183     }
184
185     @Override
186     public int getId() {
187         return round;
188     }
189
190 }