001    /**
002     * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.kernel.search.generic;
016    
017    import com.liferay.portal.kernel.search.BaseQueryImpl;
018    import com.liferay.portal.kernel.search.query.QueryVisitor;
019    
020    /**
021     * @author Michael C. Han
022     */
023    public class FuzzyQuery extends BaseQueryImpl {
024    
025            public FuzzyQuery(String field, String value) {
026                    _field = field;
027                    _value = value;
028            }
029    
030            @Override
031            public <T> T accept(QueryVisitor<T> queryVisitor) {
032                    return queryVisitor.visitQuery(this);
033            }
034    
035            public String getField() {
036                    return _field;
037            }
038    
039            public Float getFuzziness() {
040                    return _fuzziness;
041            }
042    
043            public Integer getMaxEdits() {
044                    return _maxEdits;
045            }
046    
047            public Integer getMaxExpansions() {
048                    return _maxExpansions;
049            }
050    
051            public Integer getPrefixLength() {
052                    return _prefixLength;
053            }
054    
055            public String getValue() {
056                    return _value;
057            }
058    
059            public void setFuzziness(Float fuzziness) {
060                    _fuzziness = fuzziness;
061            }
062    
063            public void setMaxEdits(Integer maxEdits) {
064                    _maxEdits = maxEdits;
065            }
066    
067            public void setMaxExpansions(Integer maxExpansions) {
068                    _maxExpansions = maxExpansions;
069            }
070    
071            public void setPrefixLength(Integer prefixLength) {
072                    _prefixLength = prefixLength;
073            }
074    
075            private final String _field;
076            private Float _fuzziness;
077            private Integer _maxEdits;
078            private Integer _maxExpansions;
079            private Integer _prefixLength;
080            private final String _value;
081    
082    }