blob: c7d1a215ce340b296d39f2c910b8744958d58e5f (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.schema.parser;
import com.yahoo.schema.document.Case;
import com.yahoo.schema.document.MatchType;
import com.yahoo.schema.document.MatchAlgorithm;
import java.util.Optional;
/**
* This class holds the extracted information after parsing a "match"
* block, using simple data structures as far as possible. Do not put
* advanced logic here!
*
* @author arnej27959
*/
public class ParsedMatchSettings {
private MatchType matchType = null;
private Case matchCase = null;
private MatchAlgorithm matchAlgorithm = null;
private String exactTerminator = null;
private Integer gramSize = null;
private Integer maxLength = null;
private Integer maxTermOccurrences = null;
Optional<MatchType> getMatchType() { return Optional.ofNullable(matchType); }
Optional<Case> getMatchCase() { return Optional.ofNullable(matchCase); }
Optional<MatchAlgorithm> getMatchAlgorithm() { return Optional.ofNullable(matchAlgorithm); }
Optional<String> getExactTerminator() { return Optional.ofNullable(exactTerminator); }
Optional<Integer> getGramSize() { return Optional.ofNullable(gramSize); }
Optional<Integer> getMaxLength() { return Optional.ofNullable(maxLength); }
Optional<Integer> getMaxTermOccurrences() { return Optional.ofNullable(maxTermOccurrences); }
// TODO - consider allowing each set only once:
void setType(MatchType value) { this.matchType = value; }
void setCase(Case value) { this.matchCase = value; }
void setAlgorithm(MatchAlgorithm value) { this.matchAlgorithm = value; }
void setExactTerminator(String value) { this.exactTerminator = value; }
void setGramSize(int value) { this.gramSize = value; }
void setMaxLength(int value) { this.maxLength = value; }
void setMaxTermOccurrences(int value) { this.maxTermOccurrences = value; }
}
|