Class AbstractDuplicateAttributeConfiguration<T>
- java.lang.Object
-
- org.ametys.cms.duplicate.contents.attr.AbstractDuplicateAttributeConfiguration<T>
-
- Type Parameters:
T- The type of the attribute
- All Implemented Interfaces:
DuplicateAttributeConfiguration<T>
- Direct Known Subclasses:
BooleanDuplicateAttributeConfiguration,ContentDuplicateAttributeConfiguration,DateDuplicateAttributeConfiguration,DateTimeDuplicateAttributeConfiguration,DoubleDuplicateAttributeConfiguration,LongDuplicateAttributeConfiguration,StringDuplicateAttributeConfiguration
public abstract class AbstractDuplicateAttributeConfiguration<T> extends Object implements DuplicateAttributeConfiguration<T>
This abstract class represents aDuplicateAttributeConfiguration
-
-
Constructor Summary
Constructors Constructor Description AbstractDuplicateAttributeConfiguration(Configuration configuration, String attributeType)Create a new DuplicateAttributeConfiguration
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected boolean_computeCheckNearDuplicate(Configuration configuration)Check if this attribute should also check for near duplicatesbooleancheckNearDuplicate()Check if we should check for near duplicateprotected QuerygetDuplicate(T value, boolean nearDuplicateQuery)Get the query to find duplicate of this attributesprotected abstract QuerygetDuplicateQuery(T value)Get the query to check if other contents have the same valueprotected abstract QuerygetExistQuery()Get the query to check if a field is filledprotected QuerygetNearDuplicateQuery(T value)Get the query to check if other contents have almost the same valueStringgetPath()Set the path of the attributeQuerygetQuery(Object value, boolean nearDuplicateQuery)Get the query to find duplicate of this attributesStringgetType()Get the type of the attributeprotected booleanisEmpty(Object value)Check if the value is emptyvoidsetPath(String path)Set the path of the attributevoidsetType(String type)Set the type of the attribute
-
-
-
Field Detail
-
_checkNearDuplicate
protected boolean _checkNearDuplicate
Defines this attribute should also check for near duplicates.
-
-
Constructor Detail
-
AbstractDuplicateAttributeConfiguration
public AbstractDuplicateAttributeConfiguration(Configuration configuration, String attributeType) throws ConfigurationException
Create a new DuplicateAttributeConfiguration- Parameters:
configuration- the configuration used to create the DuplicateAttributeConfigurationattributeType- the attribute type id- Throws:
ConfigurationException- if the configuration is not valid.
-
-
Method Detail
-
_computeCheckNearDuplicate
protected boolean _computeCheckNearDuplicate(Configuration configuration)
Check if this attribute should also check for near duplicates- Parameters:
configuration- the configuration used to create the DuplicateAttributeConfiguration- Returns:
- true if this attribute should also check for near duplicates
-
getType
public String getType()
Description copied from interface:DuplicateAttributeConfigurationGet the type of the attribute- Specified by:
getTypein interfaceDuplicateAttributeConfiguration<T>- Returns:
- the type of the attribute
-
setType
public void setType(String type)
Description copied from interface:DuplicateAttributeConfigurationSet the type of the attribute- Specified by:
setTypein interfaceDuplicateAttributeConfiguration<T>- Parameters:
type- the type of the attribute
-
getPath
public String getPath()
Description copied from interface:DuplicateAttributeConfigurationSet the path of the attribute- Specified by:
getPathin interfaceDuplicateAttributeConfiguration<T>- Returns:
- the path of the attribute
-
setPath
public void setPath(String path)
Description copied from interface:DuplicateAttributeConfigurationSet the path of the attribute- Specified by:
setPathin interfaceDuplicateAttributeConfiguration<T>- Parameters:
path- the path of the attribute
-
checkNearDuplicate
public boolean checkNearDuplicate()
Description copied from interface:DuplicateAttributeConfigurationCheck if we should check for near duplicate- Specified by:
checkNearDuplicatein interfaceDuplicateAttributeConfiguration<T>- Returns:
- true if we should check for near duplicate
-
getExistQuery
protected abstract Query getExistQuery()
Get the query to check if a field is filled- Returns:
- the query
-
getDuplicateQuery
protected abstract Query getDuplicateQuery(T value)
Get the query to check if other contents have the same value- Parameters:
value- the value to check- Returns:
- the query
-
getNearDuplicateQuery
protected Query getNearDuplicateQuery(T value)
Get the query to check if other contents have almost the same value- Parameters:
value- the value to check- Returns:
- the query
-
getDuplicate
protected Query getDuplicate(T value, boolean nearDuplicateQuery)
Get the query to find duplicate of this attributes- Parameters:
value- the value of the attributenearDuplicateQuery- true if the query should check near duplicates- Returns:
- the query to find duplicate of this attributes
-
getQuery
public Query getQuery(Object value, boolean nearDuplicateQuery)
Description copied from interface:DuplicateAttributeConfigurationGet the query to find duplicate of this attributes- Specified by:
getQueryin interfaceDuplicateAttributeConfiguration<T>- Parameters:
value- the value of the attributenearDuplicateQuery- true if the query should check near duplicates- Returns:
- the query to find duplicate of this attributes
-
-