[LIB-13] Lichess format entities for JSON parsing
[chesshog-scanner.git] / src / main / java / org / hedgecode / chess / scanner / json / lichess / JSONGame.java
1 /*
2  * Copyright (c) 2019-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.chess.scanner.json.lichess;
18
19 import com.google.gson.annotations.SerializedName;
20
21 import org.hedgecode.chess.scanner.format.lichess.Game;
22 import org.hedgecode.chess.scanner.format.lichess.Status;
23
24 /**
25  * JSONGame
26  *
27  * @author Dmitry Samoshin aka gotty
28  */
29 public class JSONGame implements Game {
30
31     @SerializedName("id")
32     private String id;
33
34     @SerializedName("speed")
35     private String speed;
36
37     @SerializedName("rated")
38     private boolean rated;
39
40     @SerializedName("initialFen")
41     private String initialFen;
42
43     @SerializedName("fen")
44     private String fen;
45
46     @SerializedName("player")
47     private String player;
48
49     @SerializedName("turns")
50     private int turns;
51
52     @SerializedName("startedAtTurn")
53     private int startedAtTurn;
54
55     @SerializedName("status")
56     private JSONStatus status;
57
58     @SerializedName("createdAt")
59     private long createdAt;
60
61     @SerializedName("winner")
62     private String winner;
63
64     @SerializedName("lastMove")
65     private String lastMove;
66
67     JSONGame() {
68     }
69
70     @Override
71     public String id() {
72         return id;
73     }
74
75     @Override
76     public String speed() {
77         return speed;
78     }
79
80     @Override
81     public boolean rated() {
82         return rated;
83     }
84
85     @Override
86     public String initialFen() {
87         return initialFen;
88     }
89
90     @Override
91     public String fen() {
92         return fen;
93     }
94
95     @Override
96     public String player() {
97         return player;
98     }
99
100     @Override
101     public int turns() {
102         return turns;
103     }
104
105     @Override
106     public int startedAtTurn() {
107         return startedAtTurn;
108     }
109
110     @Override
111     public Status status() {
112         return status;
113     }
114
115     @Override
116     public long createdAt() {
117         return createdAt;
118     }
119
120     @Override
121     public String winner() {
122         return winner;
123     }
124
125     @Override
126     public String lastMove() {
127         return lastMove;
128     }
129
130 }