001/* 002 * Copyright 2015 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.search.model; 017 018import java.util.Map; 019 020import org.ametys.cms.search.query.Query.LogicalOperator; 021import org.ametys.cms.search.query.Query.Operator; 022 023/** 024 * Represents the definition of a criterion definition of a {@link SearchModel} 025 * @param <T> Type of the criterion value 026 */ 027public interface SearchModelCriterionDefinition<T> extends CriterionDefinition<T> 028{ 029 /** 030 * Get the criterion Operator. 031 * @return the criterion Operator. 032 */ 033 public Operator getOperator(); 034 035 /** 036 * Set the criterion Operator. 037 * @param operator the Operator to set. 038 */ 039 public void setOperator(Operator operator); 040 041 /** 042 * Set the the logical operator for multi-valued criteria 043 * @param multipleOperandOperator the logical operator to set 044 */ 045 public void setMultipleOperandOperator(LogicalOperator multipleOperandOperator); 046 047 /** 048 * Copy the current criterion definition in the given one. 049 * @param criterion the copy 050 * @param contextualParameters the contextual parameters 051 */ 052 public void copyTo(SearchModelCriterionDefinition<T> criterion, Map<String, Object> contextualParameters); 053 054 @Override 055 public SearchModel getModel(); 056}