|
| 1 | +/* |
| 2 | + * DISCLAIMER |
| 3 | + * |
| 4 | + * Copyright 2016 ArangoDB GmbH, Cologne, Germany |
| 5 | + * |
| 6 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 7 | + * you may not use this file except in compliance with the License. |
| 8 | + * You may obtain a copy of the License at |
| 9 | + * |
| 10 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 11 | + * |
| 12 | + * Unless required by applicable law or agreed to in writing, software |
| 13 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 14 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 15 | + * See the License for the specific language governing permissions and |
| 16 | + * limitations under the License. |
| 17 | + * |
| 18 | + * Copyright holder is ArangoDB GmbH, Cologne, Germany |
| 19 | + */ |
| 20 | + |
| 21 | +package com.arangodb.entity.arangosearch.analyzer; |
| 22 | + |
| 23 | + |
| 24 | +import com.arangodb.entity.arangosearch.AnalyzerType; |
| 25 | + |
| 26 | +import java.util.Objects; |
| 27 | + |
| 28 | +/** |
| 29 | + * An Analyzer capable of breaking up text into tokens using multiple delimiters. |
| 30 | + * Unlike with the delimiter Analyzer, the multi_delimiter Analyzer does not support quoting fields. |
| 31 | + * |
| 32 | + * @author Michele Rastelli |
| 33 | + * @see <a href= "https://docs.arangodb.com/devel/index-and-search/analyzers/#multi_delimiter">API Documentation</a> |
| 34 | + * @since ArangoDB 3.12 |
| 35 | + */ |
| 36 | +public final class MultiDelimiterAnalyzer extends SearchAnalyzer { |
| 37 | + private MultiDelimiterAnalyzerProperties properties; |
| 38 | + |
| 39 | + public MultiDelimiterAnalyzer() { |
| 40 | + setType(AnalyzerType.multi_delimiter); |
| 41 | + } |
| 42 | + |
| 43 | + public MultiDelimiterAnalyzerProperties getProperties() { |
| 44 | + return properties; |
| 45 | + } |
| 46 | + |
| 47 | + public void setProperties(MultiDelimiterAnalyzerProperties properties) { |
| 48 | + this.properties = properties; |
| 49 | + } |
| 50 | + |
| 51 | + @Override |
| 52 | + public boolean equals(Object o) { |
| 53 | + if (this == o) return true; |
| 54 | + if (o == null || getClass() != o.getClass()) return false; |
| 55 | + if (!super.equals(o)) return false; |
| 56 | + MultiDelimiterAnalyzer that = (MultiDelimiterAnalyzer) o; |
| 57 | + return Objects.equals(properties, that.properties); |
| 58 | + } |
| 59 | + |
| 60 | + @Override |
| 61 | + public int hashCode() { |
| 62 | + return Objects.hash(super.hashCode(), properties); |
| 63 | + } |
| 64 | +} |
0 commit comments