[LIB-10] Correct RequestParams for Event Rounds and Seeding
[snooker-score-api.git] / src / main / java / org / hedgecode / snooker / request / RequestParams.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.request;
18
19 import org.hedgecode.snooker.api.PlayerCategory;
20 import org.hedgecode.snooker.api.RankingType;
21 import org.hedgecode.snooker.api.Season;
22
23 /**
24  * Input Params for Request.
25  *
26  * @author Dmitry Samoshin aka gotty
27  */
28 public class RequestParams {
29
30     private int playerId;
31     private int eventId;
32     private int roundId;
33     private int matchNumber;
34     private Season season;
35     private PlayerCategory category;
36     private RankingType rankingType;
37
38     public RequestParams(RequestType type, int id, Season season) {
39         switch (type) {
40             case PLAYER:
41                 this.playerId = id;
42                 break;
43             case PLAYER_MATCHES:
44                 this.playerId = id;
45                 this.season = season;
46                 break;
47             case EVENT:
48             case EVENT_MATCHES:
49             case EVENT_PLAYERS:
50             case EVENT_ROUNDS:
51             case EVENT_SEEDING:
52                 this.eventId = id;
53                 break;
54             case SEASON_EVENTS:
55                 this.season = season;
56                 break;
57             default:
58         }
59     }
60
61     public RequestParams(int eventId, int roundId, int matchNumber) {
62         this.eventId = eventId;
63         this.roundId = roundId;
64         this.matchNumber = matchNumber;
65     }
66
67     public RequestParams(Season season, PlayerCategory category) {
68         this.season = season;
69         this.category = category;
70     }
71
72     public RequestParams(Season season, RankingType rankingType) {
73         this.season = season;
74         this.rankingType = rankingType;
75     }
76
77     public int getPlayerId() {
78         return playerId;
79     }
80
81     public void setPlayerId(int playerId) {
82         this.playerId = playerId;
83     }
84
85     public int getEventId() {
86         return eventId;
87     }
88
89     public void setEventId(int eventId) {
90         this.eventId = eventId;
91     }
92
93     public int getRoundId() {
94         return roundId;
95     }
96
97     public void setRoundId(int roundId) {
98         this.roundId = roundId;
99     }
100
101     public int getMatchNumber() {
102         return matchNumber;
103     }
104
105     public void setMatchNumber(int matchNumber) {
106         this.matchNumber = matchNumber;
107     }
108
109     public Season getSeason() {
110         return season;
111     }
112
113     public void setSeason(Season season) {
114         this.season = season;
115     }
116
117     public PlayerCategory getCategory() {
118         return category;
119     }
120
121     public void setCategory(PlayerCategory category) {
122         this.category = category;
123     }
124
125     public RankingType getRankingType() {
126         return rankingType;
127     }
128
129     public void setRankingType(RankingType rankingType) {
130         this.rankingType = rankingType;
131     }
132
133 }