[LIB-5] Collection empty objects,reporting and serializable
[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             default:
56         }
57     }
58
59     public RequestParams(int eventId, int roundId, int matchNumber) {
60         this.eventId = eventId;
61         this.roundId = roundId;
62         this.matchNumber = matchNumber;
63     }
64
65     public RequestParams(Season season, PlayerCategory category) {
66         this.season = season;
67         this.category = category;
68     }
69
70     public RequestParams(Season season, RankingType rankingType) {
71         this.season = season;
72         this.rankingType = rankingType;
73     }
74
75     public int getPlayerId() {
76         return playerId;
77     }
78
79     public void setPlayerId(int playerId) {
80         this.playerId = playerId;
81     }
82
83     public int getEventId() {
84         return eventId;
85     }
86
87     public void setEventId(int eventId) {
88         this.eventId = eventId;
89     }
90
91     public int getRoundId() {
92         return roundId;
93     }
94
95     public void setRoundId(int roundId) {
96         this.roundId = roundId;
97     }
98
99     public int getMatchNumber() {
100         return matchNumber;
101     }
102
103     public void setMatchNumber(int matchNumber) {
104         this.matchNumber = matchNumber;
105     }
106
107     public Season getSeason() {
108         return season;
109     }
110
111     public void setSeason(Season season) {
112         this.season = season;
113     }
114
115     public PlayerCategory getCategory() {
116         return category;
117     }
118
119     public void setCategory(PlayerCategory category) {
120         this.category = category;
121     }
122
123     public RankingType getRankingType() {
124         return rankingType;
125     }
126
127     public void setRankingType(RankingType rankingType) {
128         this.rankingType = rankingType;
129     }
130
131 }