[LIB-13] Add function to Scanner API
[chesshog-scanner.git] / src / main / java / org / hedgecode / chess / scanner / regex / RegexParams.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.regex;
18
19 /**
20  * RegexParams
21  *
22  * @author Dmitry Samoshin aka gotty
23  */
24 public final class RegexParams {
25
26     public static final String TOURNAMENT_ID = "[tournamentId]";
27     public static final String PAGE_ID = "[pageId]";
28     public static final String GAME_ID = "[gameId]";
29     public static final String QUERY = "[query]";
30
31     private String tournamentId;
32     private String pageId;
33     private String gameId;
34     private String query;
35     private boolean isUrlEncode;
36
37     public RegexParams(String tournamentId, String pageId) {
38         this.tournamentId = tournamentId;
39         this.pageId = pageId;
40     }
41
42     public RegexParams(String gameId) {
43         this.gameId = gameId;
44     }
45
46     public RegexParams(String gameId, String tournamentId, boolean withTournament) {
47         this.gameId = gameId;
48         if (withTournament) {
49             this.tournamentId = tournamentId;
50         }
51     }
52
53     public RegexParams(String query, boolean isUrlEncode) {
54         this.query = query;
55         this.isUrlEncode = isUrlEncode;
56     }
57
58     public String getTournamentId() {
59         return tournamentId;
60     }
61
62     public String getPageId() {
63         return pageId;
64     }
65
66     public String getGameId() {
67         return gameId;
68     }
69
70     public String getQuery() {
71         return query;
72     }
73
74     public boolean isUrlEncode() {
75         return isUrlEncode;
76     }
77
78 }