[LIB-2] Add snooker-score-api source files
[snooker-score-api.git] / src / main / java / org / hedgecode / snooker / request / RequestParams.java
diff --git a/src/main/java/org/hedgecode/snooker/request/RequestParams.java b/src/main/java/org/hedgecode/snooker/request/RequestParams.java
new file mode 100644 (file)
index 0000000..a11da9b
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2017. Developed by Hedgecode.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.hedgecode.snooker.request;
+
+import org.hedgecode.snooker.api.PlayerCategory;
+import org.hedgecode.snooker.api.RankingType;
+import org.hedgecode.snooker.api.Season;
+
+/**
+ * Input Params for Request.
+ *
+ * @author Dmitry Samoshin aka gotty
+ */
+public class RequestParams {
+
+    private int playerId;
+    private int eventId;
+    private int roundId;
+    private int matchNumber;
+    private Season season;
+    private PlayerCategory category;
+    private RankingType rankingType;
+
+    public RequestParams(RequestType type, int id, Season season) {
+        switch (type) {
+            case PLAYER:
+                this.playerId = id;
+                break;
+            case PLAYER_MATCHES:
+                this.playerId = id;
+                this.season = season;
+                break;
+            case EVENT:
+            case EVENT_MATCHES:
+            case EVENT_PLAYERS:
+                this.eventId = id;
+                break;
+            case SEASON_EVENTS:
+                this.season = season;
+                break;
+        }
+    }
+
+    public RequestParams(int eventId, int roundId, int matchNumber) {
+        this.eventId = eventId;
+        this.roundId = roundId;
+        this.matchNumber = matchNumber;
+    }
+
+    public RequestParams(Season season, PlayerCategory category) {
+        this.season = season;
+        this.category = category;
+    }
+
+    public RequestParams(Season season, RankingType rankingType) {
+        this.season = season;
+        this.rankingType = rankingType;
+    }
+
+    public int getPlayerId() {
+        return playerId;
+    }
+
+    public void setPlayerId(int playerId) {
+        this.playerId = playerId;
+    }
+
+    public int getEventId() {
+        return eventId;
+    }
+
+    public void setEventId(int eventId) {
+        this.eventId = eventId;
+    }
+
+    public int getRoundId() {
+        return roundId;
+    }
+
+    public void setRoundId(int roundId) {
+        this.roundId = roundId;
+    }
+
+    public int getMatchNumber() {
+        return matchNumber;
+    }
+
+    public void setMatchNumber(int matchNumber) {
+        this.matchNumber = matchNumber;
+    }
+
+    public Season getSeason() {
+        return season;
+    }
+
+    public void setSeason(Season season) {
+        this.season = season;
+    }
+
+    public PlayerCategory getCategory() {
+        return category;
+    }
+
+    public void setCategory(PlayerCategory category) {
+        this.category = category;
+    }
+
+    public RankingType getRankingType() {
+        return rankingType;
+    }
+
+    public void setRankingType(RankingType rankingType) {
+        this.rankingType = rankingType;
+    }
+
+}