com.yahoo.schema.parser.ParsedMatchSettings Maven / Gradle / Ivy
// 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;
private Integer maxTokenLength = null;
Optional getMatchType() { return Optional.ofNullable(matchType); }
Optional getMatchCase() { return Optional.ofNullable(matchCase); }
Optional getMatchAlgorithm() { return Optional.ofNullable(matchAlgorithm); }
Optional getExactTerminator() { return Optional.ofNullable(exactTerminator); }
Optional getGramSize() { return Optional.ofNullable(gramSize); }
Optional getMaxLength() { return Optional.ofNullable(maxLength); }
Optional getMaxTermOccurrences() { return Optional.ofNullable(maxTermOccurrences); }
Optional getMaxTokenLength() { return Optional.ofNullable(maxTokenLength); }
// 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; }
void setMaxTokenLength(int value) { this.maxTokenLength = value; }
}