2 * Copyright (c) 2019-2020. 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.scanner;
19 import static org.hedgecode.chess.scanner.ChessHogScannerConstants.*;
24 * @author Dmitry Samoshin aka gotty
26 public enum ScannerType {
28 CHESSGAMES ( TYPE_CHESSGAMES, DOMAIN_CHESSGAMES ),
29 LICHESS ( TYPE_LICHESS, DOMAIN_LICHESS ),
30 CHESSBOMB ( TYPE_CHESSBOMB, DOMAIN_CHESSBOMB ),
31 CHESS24 ( TYPE_CHESS24, DOMAIN_CHESS24 ),
32 CHESSCOM ( TYPE_CHESSCOM, DOMAIN_CHESSCOM );
35 private String domain;
37 ScannerType(String type, String domain) {
42 public String type() {
46 public String domain() {
50 public static ScannerType byType(String type) {
51 for (ScannerType scannerType : ScannerType.values()) {
52 if (scannerType.type.equals(type))
58 public static ScannerType byHost(String host) {
60 for (ScannerType scannerType : ScannerType.values()) {
61 if (host.contains(scannerType.domain))