[LIB-2] Add snooker-score-api source files
[snooker-score-api.git] / src / main / java / org / hedgecode / snooker / request / RequestParams.java
1 /*
2  * Copyright (c) 2017. 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                 this.eventId = id;
51                 break;
52             case SEASON_EVENTS:
53                 this.season = season;
54                 break;
55         }
56     }
57
58     public RequestParams(int eventId, int roundId, int matchNumber) {
59         this.eventId = eventId;
60         this.roundId = roundId;
61         this.matchNumber = matchNumber;
62     }
63
64     public RequestParams(Season season, PlayerCategory category) {
65         this.season = season;
66         this.category = category;
67     }
68
69     public RequestParams(Season season, RankingType rankingType) {
70         this.season = season;
71         this.rankingType = rankingType;
72     }
73
74     public int getPlayerId() {
75         return playerId;
76     }
77
78     public void setPlayerId(int playerId) {
79         this.playerId = playerId;
80     }
81
82     public int getEventId() {
83         return eventId;
84     }
85
86     public void setEventId(int eventId) {
87         this.eventId = eventId;
88     }
89
90     public int getRoundId() {
91         return roundId;
92     }
93
94     public void setRoundId(int roundId) {
95         this.roundId = roundId;
96     }
97
98     public int getMatchNumber() {
99         return matchNumber;
100     }
101
102     public void setMatchNumber(int matchNumber) {
103         this.matchNumber = matchNumber;
104     }
105
106     public Season getSeason() {
107         return season;
108     }
109
110     public void setSeason(Season season) {
111         this.season = season;
112     }
113
114     public PlayerCategory getCategory() {
115         return category;
116     }
117
118     public void setCategory(PlayerCategory category) {
119         this.category = category;
120     }
121
122     public RankingType getRankingType() {
123         return rankingType;
124     }
125
126     public void setRankingType(RankingType rankingType) {
127         this.rankingType = rankingType;
128     }
129
130 }