[LIB-13] Lichess format entities for JSON parsing
[chesshog-scanner.git] / src / main / java / org / hedgecode / chess / scanner / json / lichess / JSONGame.java
diff --git a/src/main/java/org/hedgecode/chess/scanner/json/lichess/JSONGame.java b/src/main/java/org/hedgecode/chess/scanner/json/lichess/JSONGame.java
new file mode 100644 (file)
index 0000000..5037cda
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * Copyright (c) 2019-2020. 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.chess.scanner.json.lichess;
+
+import com.google.gson.annotations.SerializedName;
+
+import org.hedgecode.chess.scanner.format.lichess.Game;
+import org.hedgecode.chess.scanner.format.lichess.Status;
+
+/**
+ * JSONGame
+ *
+ * @author Dmitry Samoshin aka gotty
+ */
+public class JSONGame implements Game {
+
+    @SerializedName("id")
+    private String id;
+
+    @SerializedName("speed")
+    private String speed;
+
+    @SerializedName("rated")
+    private boolean rated;
+
+    @SerializedName("initialFen")
+    private String initialFen;
+
+    @SerializedName("fen")
+    private String fen;
+
+    @SerializedName("player")
+    private String player;
+
+    @SerializedName("turns")
+    private int turns;
+
+    @SerializedName("startedAtTurn")
+    private int startedAtTurn;
+
+    @SerializedName("status")
+    private JSONStatus status;
+
+    @SerializedName("createdAt")
+    private long createdAt;
+
+    @SerializedName("winner")
+    private String winner;
+
+    @SerializedName("lastMove")
+    private String lastMove;
+
+    JSONGame() {
+    }
+
+    @Override
+    public String id() {
+        return id;
+    }
+
+    @Override
+    public String speed() {
+        return speed;
+    }
+
+    @Override
+    public boolean rated() {
+        return rated;
+    }
+
+    @Override
+    public String initialFen() {
+        return initialFen;
+    }
+
+    @Override
+    public String fen() {
+        return fen;
+    }
+
+    @Override
+    public String player() {
+        return player;
+    }
+
+    @Override
+    public int turns() {
+        return turns;
+    }
+
+    @Override
+    public int startedAtTurn() {
+        return startedAtTurn;
+    }
+
+    @Override
+    public Status status() {
+        return status;
+    }
+
+    @Override
+    public long createdAt() {
+        return createdAt;
+    }
+
+    @Override
+    public String winner() {
+        return winner;
+    }
+
+    @Override
+    public String lastMove() {
+        return lastMove;
+    }
+
+}