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 duplicatesboolean
checkNearDuplicate()
Check if we should check for near duplicateprotected Query
getDuplicate(T value, boolean nearDuplicateQuery)
Get the query to find duplicate of this attributesprotected abstract Query
getDuplicateQuery(T value)
Get the query to check if other contents have the same valueprotected abstract Query
getExistQuery()
Get the query to check if a field is filledprotected Query
getNearDuplicateQuery(T value)
Get the query to check if other contents have almost the same valueString
getPath()
Set the path of the attributeQuery
getQuery(Object value, boolean nearDuplicateQuery)
Get the query to find duplicate of this attributesString
getType()
Get the type of the attributeprotected boolean
isEmpty(Object value)
Check if the value is emptyvoid
setPath(String path)
Set the path of the attributevoid
setType(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:DuplicateAttributeConfiguration
Get the type of the attribute- Specified by:
getType
in interfaceDuplicateAttributeConfiguration<T>
- Returns:
- the type of the attribute
-
setType
public void setType(String type)
Description copied from interface:DuplicateAttributeConfiguration
Set the type of the attribute- Specified by:
setType
in interfaceDuplicateAttributeConfiguration<T>
- Parameters:
type
- the type of the attribute
-
getPath
public String getPath()
Description copied from interface:DuplicateAttributeConfiguration
Set the path of the attribute- Specified by:
getPath
in interfaceDuplicateAttributeConfiguration<T>
- Returns:
- the path of the attribute
-
setPath
public void setPath(String path)
Description copied from interface:DuplicateAttributeConfiguration
Set the path of the attribute- Specified by:
setPath
in interfaceDuplicateAttributeConfiguration<T>
- Parameters:
path
- the path of the attribute
-
checkNearDuplicate
public boolean checkNearDuplicate()
Description copied from interface:DuplicateAttributeConfiguration
Check if we should check for near duplicate- Specified by:
checkNearDuplicate
in 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:DuplicateAttributeConfiguration
Get the query to find duplicate of this attributes- Specified by:
getQuery
in 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
-
-