2 * Copyright (c) 2018-2019. Developed by Hedgecode.
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package org.hedgecode.chess.qrcode;
20 * Mode of data type stored in chess-specific QR Codes.
22 * @author Dmitry Samoshin aka gotty
24 public enum ChessQRCodeMode {
32 public static final int CODE_LENGTH = 3;
34 public boolean isPosition() {
35 return FEN.equals(this) || TCD.equals(this);
38 public boolean isGame() {
39 return PGN.equals(this) || TCG.equals(this);
42 public boolean isArchive() {
43 return ZIP.equals(this);
46 public static ChessQRCodeMode byCode(String code) {
47 for (ChessQRCodeMode mode : ChessQRCodeMode.values()) {
48 if (mode.name().equals(code))