001/*
002 *  Copyright 2021 Anyware Services
003 *
004 *  Licensed under the Apache License, Version 2.0 (the "License");
005 *  you may not use this file except in compliance with the License.
006 *  You may obtain a copy of the License at
007 *
008 *      http://www.apache.org/licenses/LICENSE-2.0
009 *
010 *  Unless required by applicable law or agreed to in writing, software
011 *  distributed under the License is distributed on an "AS IS" BASIS,
012 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013 *  See the License for the specific language governing permissions and
014 *  limitations under the License.
015 */
016package org.ametys.cms.duplicate.contents.attr;
017
018import org.ametys.cms.search.query.Query;
019
020/**
021 * Represents the configuration for an attribute of content duplicate detection configuration
022 * @param <T> The type of the attribute
023 */
024public interface DuplicateAttributeConfiguration<T>
025{
026    /**
027     * Get the type of the attribute
028     * @return the type of the attribute
029     */
030    public String getType();
031
032    /**
033     * Set the type of the attribute
034     * @param type the type of the attribute
035     */
036    public void setType(String type);
037
038    /**
039     * Set the path of the attribute
040     * @return the path of the attribute
041     */
042    public String getPath();
043
044    /**
045     * Set the path of the attribute
046     * @param path the path of the attribute
047     */
048    public void setPath(String path);
049
050    /**
051     * Check if we should check for near duplicate
052     * @return true if we should check for near duplicate
053     */
054    public boolean checkNearDuplicate();
055
056    /**
057     * Get the query to find duplicate of this attributes
058     * @param value the value of the attribute
059     * @param nearDuplicateQuery true if the query should check near duplicates
060     * @return the query to find duplicate of this attributes
061     */
062    public Query getQuery(Object value, boolean nearDuplicateQuery);
063}